[Cmake] CMake Newbie (Trying to understand ADD_DEFINITIONS)

Brand Hunt brandhunt at hotmail.com
Fri Aug 20 17:55:19 EDT 2004


Hi,

I've just started using CMake and I'm having troubles getting the behaviour 
I want.

I want to have 2 executables built with the same files, but one executable 
needs an extra -D (for a different debugging level.)

I've tried this:

ADD_EXECUTABLE( application application.cpp )
TARGET_LINK_LIBRARIES( application mylib )

ADD_DEFINITIONS( -DHYPER_DEBUG=1 )
ADD_EXECUTABLE( application_no_ship application.cpp )
TARGET_LINK_LIBRARIES( application mylib )
REMOVE_DEFINITIONS( -DHYPER_DEBUG=1 )

But, from looking at the Makefile generated, it seems that all applications 
built use the same preprocessor definitions.  Is there an easy way to define 
different things at the application level?

Thanks,
Brand




More information about the Cmake mailing list