[CMake] per-configuration defines

Martin Apel martin.apel at simpack.de
Wed Dec 10 03:55:11 EST 2008


Michele Bosi wrote:
> Hi all,
> is there a way to issue extra preprocessor defines on a
> build-configuration basis, that is: I would like to add some
> preprocessor defines to my release builds and others to my debug
> builds. Basically I would need something like:
>
> add_definitions_release(-DDEFINE1 -DDEFINE2)
> add_definitions_debug(-DDEFINE3 -DDEFINE4)
>
> I know that I could also do it using the target properties like:
> SET_TARGET_PROPERTIES(target PROPERTIES
>              COMPILE_DEFINITIONS_<CONFIG> "-DDEFINEn") but since I
> have several targets spread all over the world it would be nice to be
> able to add such defines once and for all :)
>
> Regards,
> Michele
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
>   
The easiest way is to simply add these defines to CMAKE_C_FLAGS_DEBUG,
CMAKE_C_FLAGS_RELEASE etc.

Regards,

Martin

____________
Virus checked by G DATA AntiVirus
Version: AVF 19.180 from 09.12.2008




More information about the CMake mailing list