[cmake-developers] Default compile options

Robert Goulet Robert.Goulet at autodesk.com
Mon Aug 24 17:17:24 EDT 2015


In our root CMakeLists.txt file we do this:

set(CMAKE_C_FLAGS)
set(CMAKE_CXX_FLAGS)
set(CMAKE_C_FLAGS_DEBUG "-D_DEBUG")
set(CMAKE_CXX_FLAGS_DEBUG "-D_DEBUG")
set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG")

This is to reset the build flags for all platforms, but it doesn't seems to work very well.

For instance, if we generate a Visual Studio project, it seems to work just fine, but in a Makefile those flags are not even passed to the compiler. Is this a bug or perhaps we are not doing it right? Why would it work for VS but not makefiles?

Any suggestions?

Thanks!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150824/d38d564a/attachment.html>


More information about the cmake-developers mailing list