[Cmake] build flags

Bill Hoffman bill.hoffman at kitware.com
Wed May 23 17:18:33 EDT 2001


I just checked in this change:

I added four more cache variables on windows.
They can be found in the WindowsSystemConfig.cmake file.


CMAKE_CXX_FLAGS_RELEASE = /MD /O2
CMAKE_CXX_FLAGS_MINSIZEREL = /MD /O1
CMAKE_CXX_FLAGS_DEBUG = /MDd /Zi /Od /GZ
CMAKE_CXX_FLAGS = /W3 /Zm1000 /FD /GX /GR


They are used in the templates like this:


.... Release build .....
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL"  /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD CPP CMAKE_CXX_FLAGS


..... Debug Build......
# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "OUTPUT_LIBNAME_EXPORTS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL"  /FD /c
# ADD CPP BUILD_INCLUDES EXTRA_DEFINES /D "OUTPUT_LIBNAME_EXPORTS"
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD CPP CMAKE_CXX_FLAGS


This may be a solution to having a bunch of templates around, you can just change
cache values and build in separate bin dirs.

-Bill





More information about the CMake mailing list