[CMake] Setting COMPILE_FLAGS does not appear to work

Andrew MacDonald macdonald.andrew at gmail.com
Wed May 9 22:51:18 EDT 2007


I'd like to build several libraries with identical rules except for
the compiler flags. However setting the COMPILE_FLAGS property for
each target does not seem to work. For instance:

add_library(foo_mt STATIC ${SRCS})
set_target_properties(foo_mt PROPERTIES COMPILE_FLAGS "/MT")

add_library(foo_md STATIC ${SRCS})
set_target_properties(foo_md PROPERTIES COMPILE_FLAGS "/MD")

The flags are not added to the flags.make file (perhaps they are not
supposed to be?), and are not used during compilation. I'm using nmake
in this case.

Any ideas?

Thanks,
Andrew


More information about the CMake mailing list