[CMake] Re: Setting COMPILE_FLAGS does not appear to work

Andrew MacDonald macdonald.andrew at gmail.com
Wed May 9 23:34:18 EDT 2007


Ok, so I managed to ask two dumb questions in one day :P

I belatedly discovered that the flags in fact were being changed.
However, this brought up another question: does anyone know how to
force cmake/nmake to show you the actual flags used during
compilation? nmake /N just shows the cmake commands.

On 5/9/07, Andrew MacDonald <macdonald.andrew at gmail.com> wrote:
> 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