[CMake] question about COMPILE_DEFINITIONS_RELEASE

Tyler Roscoe tyler at cryptio.net
Wed Nov 18 11:16:17 EST 2009


On Wed, Nov 18, 2009 at 07:31:06AM -0800, Kenneth Riddile wrote:
> I'm using cmake to generate projects for Visual Studio 9.  I've
> noticed that when I use COMPILE_DEFINITIONS_RELEASE to add a
> preprocessor directive, it's only added to the "Release" configuration
> in the Visual Studio project, and not the "MinSizeRel" and
> "RelWithDebInfo" configurations.  How can I add a preprocessor
> directive for all three of these release configurations?

I think you need to add COMPILE_DEFINITIONS_MINSIZEREL etc. I would do
something like:

foreach (configuration MINSIZEREL RELWITHDEBINFO MYCONFIG)
    ... COMPILE_DEFINITIONS_${configuration} "SomeDef" ...
endforeach ()

How would you expect it to work?

tyler


More information about the CMake mailing list