[CMake] config dependent defines

Michael Wild themiwi at gmail.com
Sun Oct 17 03:44:14 EDT 2010


Your users will hate you for that, because they will not be able to override the compile-flags without modifying the CMakeLists.txt file.

You can set the COMPILE_DEFINITIONS_DEBUG property on individual targets using SET_TARGET_PROPERTIES() or on directories with SET_DIRECTORY_PROPERTIES.

HTH

Michael


On 16. Oct, 2010, at 18:40 , Laszlo Papp wrote:

> SET(CMAKE_CXX_FLAGS "-Wall")
> SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Wall -O2 -g")
> SET(CMAKE_CXX_FLAGS_RELEASE "-Wall -O2")
> SET(CMAKE_CXX_FLAGS_DEBUG  "-Wall -g3 -ggdb -O0" CACHE STRING "Debug
> options." FORCE)
> 
> An example from my configuration.
> 
> Best Regards,
> Laszlo Papp
> 
> On Sat, Oct 16, 2010 at 9:38 AM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:
>> Hi!
>> 
>> how do I define a macro (e.g. _DEBUG) only for the debug configuration?
>> 
>> Thanks,
>> 
>> -Jochen

--
There is always a well-known solution to every human problem -- neat, plausible, and wrong.
H. L. Mencken

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://www.cmake.org/pipermail/cmake/attachments/20101017/2a2c2cbf/attachment.pgp>


More information about the CMake mailing list