add_definitions() per target?

Brad King brad.king at kitware.com
Wed Apr 26 16:53:39 CEST 2006


Dirk Mueller wrote:
> Hi, 
> 
> suppose I have one source file that is compiled with -DFOO=1 for one target 
> (app_foo), and with -DBAR=1 for another target (app_bar) in the same 
> CMakeLists.txt. 
> 
> How do I do that? add_definitions() seems to be applied to all targets in one 
> CMakeLists.txt.

Use set_target_properties to set the COMPILE_FLAGS property on each target.

-Brad


More information about the Kde-buildsystem mailing list