Andreas Pakulat wrote:
> No this is not possible in general. A CMakeLists.txt file can always just > set their own compiler/linker flags. Which would require patching each and every one of them, which isn't exactly desirable. >> - Out of curiosity, what's special about the CMAKE_BUILD_TYPE=Debian build >> type? >> > > There's no such build type in CMake, see the Compilers and Tools section > here: https://cmake.org/Wiki/CMake_Useful_Variables#Various_Options that > details the built-in types in CMake. I know it doesn't exist as a preset in CMake. But take a look at the CMake files shipped with KDE4's kdelibs: those actually introduce CMAKE_C*_FLAGS_DEBIAN variables (in addition to using specific install locations, for instance). It's quite important that there is such a feature: configure and its alternatives are supposed to take CFLAGS, CXXFLAGS and family into consideration (or at least should have a mode in which they do, IMVHO). I suppose that what happens is that requesting an unknown CMAKE_BUILD_TYPE is equivalent to not requesting one at all, and also prevents downstream CMake files to pick a default preset if CMAKE_BUILD_TYPE hasn't been defined by the caller. I've had a better look at the control file I mentioned, and found the reason why $CFLAGS and $CXXFLAGS weren't being used. It turns out that if you set CMAKE_CXX_FLAGS on the commandline, it is no longer set to include $CXXFLAGS from the environment. Comments in the control file suggest that that wasn't always the case. R. -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake