[CMake] Project being (unnecessarily) relinked

Bill Hoffman bill.hoffman at kitware.com
Wed Sep 12 08:25:23 EDT 2007


Jesper Eskilson wrote:
> Christian Ehrlicher wrote:
>   
>>> Von: Jesper Eskilson
>>> An: Jack Kelly
>>> CC: cmake at cmake.org
>>> Betreff: Re: [CMake] Project being (unnecessarily) relinked
>>>       
>>> Jack Kelly wrote:
>>>       
>>>> Is there any reason why
>>>>
>>>> IF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
>>>>   LINK_DIRECTORIES("/path/to/debug/lib")
>>>> ELSE("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
>>>>   LINK_DIRECTORIES("/path/to/release/lib")
>>>> ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
>>>>
>>>> won't work for you?
>>>>         
>>> Yes; I'm using Visual Studio project files. The build type is not set
>>> when cmake is run; it is determined by Visual Studio.
>>>
>>>       
>> And this:
>> SET(FOO_LIBRARY optimized FOO_LIBRARY_RELEASE} debug FOO_LIBRARY_DEBUG})
>>     
>
> I'm don't understand. Is that a generalized way of having
> configuration-specific values for variables, or what. And why the
> unmatched curly bracket?
>   
See the documentation for target_link_libraries or link_libraries.  
optimized and debug are
key words that can be used to specify which libraries should be used for 
which type
of build.  The mismatched curly is a typo.

-Bill



More information about the CMake mailing list