[CMake] Add configuration support to include_directories()

Robert Dailey rcdailey at gmail.com
Mon Dec 22 18:55:10 EST 2008


I apologize, but I don't see how this could possibly work for visual studio
output. It seems like you'd have 1 set of visual studio projects for debug
and one set for release. You don't know if the build type is debug or
release in CMake because the configuration is "dynamically chosen", which
basically means the user chooses the configuration *after* the CMake targets
have been generated.

Either I'm misunderstanding something or this won't work. I'll test it out
later on to see for myself, I'm just expressing my lack of confidence in
this. I do apologize if I have not appropriately explained the problem.

Thanks for your help! I'll get back with you on the results of this.

On Mon, Dec 22, 2008 at 4:11 AM, Andrey Sploshnov <
ice.nightcrawler at gmail.com> wrote:

> Sorry, I was mistaken. I meant CMAKE_BUILD_TYPE variable. You can find a
> description here:
>
> http://www.vtk.org/Wiki/CMake_Useful_Variables
>
> In my example (if you change CMAKE_BUILD_STATUS with CMAKE_BUILD_TYPE, of
> cause), CMake adds an appropriate include path for the corresponding
> configuration. Configuration is selected by mean of CMAKE_BUILD_TYPE
> variable at generation phase.
>
> For example:
>
> cmake -G "Visual Studio 8" -DCMAKE_BUILD_TYPE=Debug c:\myproject
>
> Or you can add the following snippet to set the build type by default:
>
> if (NOT CMAKE_BUILD_TYPE)
>
>   set (CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of the build,
> options are: None Debug Release")
>
> endif (NOT CMAKE_BUILD_TYPE)
>
> On Mon, Dec 22, 2008 at 3:45 AM, Robert Dailey <rcdailey at gmail.com> wrote:
>
>> Will this work in Visual Studio? How does CMake know to place the
>> appropriate include directories in the appropriate configuration?
>>
>> I also was not able to find CMAKE_BUILD_STATUS in the 2.6 documentation.
>> Where can I read about this variable?
>>
>> On Sun, Dec 21, 2008 at 1:49 PM, Andrey Sploshnov <
>> ice.nightcrawler at gmail.com> wrote:
>>
>>> May be you need something like this?
>>>
>>> include_directories (C:\includes\foo\all)
>>>
>>> if (CMAKE_BUILD_STATUS STREQUAL "Debug")
>>>
>>>   include_directories (C:\includes\foo\debug)
>>>
>>> elseif (CMAKE_BUILD_STATUS STREQUAL "Release")
>>>
>>>   include_directories (C:\includes\foo\release)
>>>
>>> endif (CMAKE_BUILD_STATUS STREQUAL "Debug")
>>>
>>> On Thu, Dec 18, 2008 at 11:13 PM, Robert Dailey <rcdailey at gmail.com>wrote:
>>>
>>>> Would it be possible to add configuration support to
>>>> include_directories()? For example, some include directories I only want to
>>>> show up in debug, some in release, and some in all configurations. I imagine
>>>> this would look a lot like target_link_libraries():
>>>>
>>>> include_directories(
>>>>     C:\includes\foo\all # This include path applies to all
>>>> configurations
>>>>     debug C:\includes\foo\debug # This include path only shows up in
>>>> debug configurations
>>>>     release C:\includes\foo\release # This include path only shows up in
>>>> release configurations
>>>> )
>>>>
>>>> _______________________________________________
>>>> CMake mailing list
>>>> CMake at cmake.org
>>>> http://www.cmake.org/mailman/listinfo/cmake
>>>>
>>>
>>>
>>>
>>> --
>>> No fate, but what we make!
>>>
>>> _______________________________________________
>>> CMake mailing list
>>> CMake at cmake.org
>>> http://www.cmake.org/mailman/listinfo/cmake
>>>
>>
>>
>
>
> --
> No fate, but what we make!
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081222/f82f434f/attachment-0001.htm>


More information about the CMake mailing list