[Cmake] MSDev multiple build types

Dekeyser, Kris Kris.Dekeyser at lms.be
Tue Aug 24 07:26:28 EDT 2004


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.



More information about the Cmake mailing list