Hi > if(CMAKE_BUILD_TYPE EQUAL Debug) > set(CMAKE_CXX_FLAGS -Wno-long-long -Wno-comment -Wwrite-strings > -std=c++0x -pedantic-errors -pedantic -Wall -W -g -gdwarf-2 -Weffc++ > -Wmain -Wextra) > else(CMAKE_BUILD_TYPE EQUAL Debug) > set(CMAKE_CXX_FLAGS -s etc) > endif(CMAKE_BUILD_TYPE EQUAL Debug)
As a total non-expert I don't see how this will work because if build type is "Debug" then CMake will use CMAKE_CXX_FLAGS_DEBUG not CMAKE_CXX_FLAGS. Am I right? Best regards David > -----Original Message----- > From: cmake-boun...@cmake.org [mailto:cmake-boun...@cmake.org] On Behalf Of > fat...@crackmonkey.us > Sent: 01 October 2010 09:50 > To: cmake@cmake.org > Subject: Re: [CMake] CMake Digest, Vol 77, Issue 104 > > > > Date: Wed, 29 Sep 2010 03:14:57 +0200 > > From: Michael Hertling <mhertl...@online.de> > > Subject: Re: [CMake] How to set compiler flags? > > To: cmake@cmake.org > > Message-ID: <4ca29311.1050...@online.de> > > Content-Type: text/plain; charset=ISO-8859-1 > > > > > [...] So I now use add_definitions instead: > > > > > > add_definitions( "-Wall -m64 -O3" ) > > > > > > Is there a better way of doing this? > > > > Don't do this at all, and adhere to the flags. > > > > Interesting - I've been doing this: > > if(CMAKE_BUILD_TYPE EQUAL Debug) > set(CMAKE_CXX_FLAGS -Wno-long-long -Wno-comment -Wwrite-strings > -std=c++0x -pedantic-errors -pedantic -Wall -W -g -gdwarf-2 -Weffc++ > -Wmain -Wextra) > else(CMAKE_BUILD_TYPE EQUAL Debug) > set(CMAKE_CXX_FLAGS -s etc) > endif(CMAKE_BUILD_TYPE EQUAL Debug) > > because it never occurred to me to do it another way. > > Is this wrong too? > > Regards, > Adam J Richardson > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the CMake FAQ at: > http://www.cmake.org/Wiki/CMake_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.cmake.org/mailman/listinfo/cmake > > > Click > https://www.mailcontrol.com/sr/m3Ke1Zwh72LTndxI!oX7Umg7i2cqMKDpatpcVrYsfjchek > 5ARGEPIsf3rgJ09!IBCXmG77JHsOszZ1ZqAaZkbg== to report this email as spam. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake