[CMake] add_definitions() or set_target_properties(... COMPILE_FLAGS)?

Dizzy dizzy at roedu.net
Tue Aug 28 04:36:18 EDT 2007


Hello

I recently noticed that I am using add_definitions() for general compiler 
flags (that have been checked previously with check_cxx_compiler_flag()) not 
just "-D" flags. I also know this works not only when compiling with gcc 
based compilers (including mingw on Windows) but also with cl.exe and Visual 
Studio. Should the add_definitions() documentation be more complete or I am 
doing something unportable?

There is also the alternative of using set_target_properties(... 
COMPILE_FLAGS) to set general compile flags but I need something to set for 
al targets inherited from some point and not repeat this command for every 
target.

Thanks!

-- 
Mihai RUSU					Email: dizzy at roedu.net
			"Linux is obsolete" -- AST


More information about the CMake mailing list