[Cmake] MSDev multiple build types

William A. Hoffman billlist at nycap.rr.com
Tue Aug 24 21:38:01 EDT 2004


Also, the LINK_LIBRARY command can be passed a full path to a library, so
the LINK_DIRECTORY is not needed.

-Bill


At 09:30 PM 8/24/2004, William A. Hoffman wrote:
>I suppose it should be more consistent.   LINK_DIRECTORIES did
>not seem to be a problem, because the whole point of having different
>libraries for debug and release was that they usually have different names
>but are in the same directory.   If the project is entirely built with
>CMake then CMake will pick the right directory.   Can you describe the situation
>you have?   There may be a way to do it without so much change.
>
>-Bill
>
>
>At 07:26 AM 8/24/2004, Dekeyser, Kris wrote:
>>OK, thanks. I got that working.
>>
>>One thing is disturbing me, however. The debug/optimized option is AFAIK
>>only available for defining link libraries. 
>>
>>Why is it not available to INCLUDE_DIRECTORIES, LINK_DIRECTORIES,
>>ADD_(CUSTOM_COMMAND/DEFINITIONS/EXECUTABLE/LIBRARY/...),
>>INSTALL_(TARGETS/FILES/PROGRAMS) etc.? We can do some hacking with
>>CONFIGURE_FILE, but not everything is possible and adding the option support
>>to most of these commands would at least simplify things.
>>
>>- Kris
>>
>>> -----Original Message-----
>>> From: William A. Hoffman [mailto:billlist at nycap.rr.com]
>>> Sent: Monday, August 23, 2004 15:17
>>> To: Dekeyser, Kris; CMake (E-mail)
>>> Subject: Re: [Cmake] MSDev multiple build types
>>> 
>>> 
>>> You can use the debug or optimized option in these commands:
>>> 
>>> LINK_LIBRARIES(library1 <debug | optimized> library2 ...)
>>> 
>>> TARGET_LINK_LIBRARIES: Link a target to given libraries.
>>> 
>>> TARGET_LINK_LIBRARIES(target library1
>>>                         <debug | optimized> library2
>>>                         ...)
>>> 
>>> Specify a list of libraries to be linked into the specified 
>>> target. The debug and optimized strings may be used to 
>>> indicate that the next library listed is to be used only for 
>>> that specific type of build .
>>> http://www.cmake.org/HTML/Documentation.html
>>> 
>>> -Bill
>>> 
>>> 
>>> At 08:51 AM 8/23/2004, Dekeyser, Kris wrote:
>>> >Our project uses some 3rd party libraries that have 
>>> different paths and
>>> >names depending on the build type. (e.g. Xerces-C)
>>> >
>>> >MSDev has multi-config project files but CMake unfortunately 
>>> can not know in
>>> >advance which build type will be choosen. This makes it 
>>> difficult (if not
>>> >impossible) to write a TARGET_LINK_LIBRARIES statement for 
>>> that library.
>>> >
>>> >I therefore wanted to force the MSDev user to choose in 
>>> advance which build
>>> >type will be used. I wrote the following code in my root 
>>> CMakeLists.txt:
>>> >
>>> >OPTION(DEBUG_BUILD "Build for debug?" TRUE)
>>> >IF(DEBUG_BUILD)
>>> >  SET(DebugBuild TRUE)
>>> >  SET(CMAKE_BUILD_TYPE Debug)
>>> >ELSE(DEBUG_BUILD)
>>> >  SET(DebugBuild FALSE)
>>> >  SET(CMAKE_BUILD_TYPE Release)
>>> >ENDIF(DEBUG_BUILD)
>>> >
>>> >That's working fine, but still the developer can select 
>>> another build type
>>> >in the MSDev environment and that will point the library to the wrong
>>> >libraries. So I added the following:
>>> >
>>> ># MsDev's multiple configurations screw up things with 
>>> libraries that have
>>> >different name and/or paths depending on the build configuration
>>> >SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
>>> >
>>> >Hoping this would disable the generation of the not-relevant 
>>> build types. To
>>> >my disappointment that did not change anything.
>>> >
>>> >"Mastering CMake" chapter 3.5 says: "[...] The variable
>>> >CMAKE_CONFIGURATION_TYPES is used to tell CMake which 
>>> configurations to put
>>> >in the workspace.[...]". Am I misinterpreting this or is 
>>> this a bug in
>>> >CMake?
>>> >
>>> >Best regards, Kris.
>>> >+-+-+- Email Confidentiality Footer +-+-+- 
>>> >Privileged/Confidential Information may be contained in this 
>>> message. If you
>>> >are not the addressee indicated in this message (or 
>>> responsible for delivery
>>> >of the message to such person), you may not print, retain, copy nor
>>> >disseminate this message or any part of it to anyone and you 
>>> should notify
>>> >the sender by reply email and destroy this message. 
>>> Neglecting this clause
>>> >could be a breach of confidence. Please advise immediately 
>>> if you or your
>>> >employer does not consent to Internet email for messages of 
>>> this kind.
>>> >Opinions, conclusions and other information in this message 
>>> that are not
>>> >related to the official business of my firm shall be 
>>> understood as neither
>>> >given nor endorsed by it.
>>> >
>>> >_______________________________________________
>>> >Cmake mailing list
>>> >Cmake at www.cmake.org
>>> >http://www.cmake.org/mailman/listinfo/cmake 
>>> 
>>+-+-+- Email Confidentiality Footer +-+-+- 
>>Privileged/Confidential Information may be contained in this message. If you
>>are not the addressee indicated in this message (or responsible for delivery
>>of the message to such person), you may not print, retain, copy nor
>>disseminate this message or any part of it to anyone and you should notify
>>the sender by reply email and destroy this message. Neglecting this clause
>>could be a breach of confidence. Please advise immediately if you or your
>>employer does not consent to Internet email for messages of this kind.
>>Opinions, conclusions and other information in this message that are not
>>related to the official business of my firm shall be understood as neither
>>given nor endorsed by it.
>
>_______________________________________________
>Cmake mailing list
>Cmake at www.cmake.org
>http://www.cmake.org/mailman/listinfo/cmake 



More information about the Cmake mailing list