[CMake] set_target_properties - compile flags problem II
Tyler Roscoe
tyler at cryptio.net
Tue Nov 24 10:29:34 EST 2009
On Sat, Nov 21, 2009 at 12:08:38PM +0100, "Sören Freudiger" wrote:
> Okay, after using google again I figured out that unlike
> LINK_FLAGS_<CONFIG> the COMPILE_FLAG property does not support
> COMPILE_FLAG_<CONFIG>.
Looks like Philip suggested a patch from the bug tracker. Did you try it
out?
> Changing the global CMAKE_CXX_FLAGS_<CONFIG> for that purpose is not
> an option because I need different flags for different project and
> different configurations.
I believe the value of CMAKE_CXX_FLAGS* is read each time you add a
target. So use something like this:
set (CMAKE_CXX_FLAGS_DEBUG_ORIG ${CMAKE_CXX_FLAGS_DEBUG})
set (CMAKE_CXX_FLAGS_DEBUG "myflag1")
add_library(mylib1 ...)
set (CMAKE_CXX_FLAGS_DEBUG "myflag2")
add_library(mylib2 ...)
set (CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG_ORIG})
tyler
More information about the CMake
mailing list