Hello, I'm using cmake in conjunction with a packaging/distribution system that aims to control the compiler and linker flags, a priori via the usual environment variables. (We're talking about MacPorts.)
Using one of the CMAKE_BUILD_TYPE presets, the value of those env. variables appears at most to be added in front of the preset options, which means user options can be overridden. That may be intended behaviour, but not ideal for my use case. Working with Debian and Ubuntu systems, I deduced that using a non-pre-defined BUILD_TYPE make cmake use the values of CFLAGS, CXXFLAGS etc, through CMAKE_C_FLAGS, CMAKE_CXX_FLAGS etc (instead of CMAKE_C*_FLAGS_RELEASE, for instance). Experimenting with -DCMAKE_BUILD_TYPE=MacPorts in the toplevel control file (cmake PortGroup), that appeared indeed to work, but I appear to have been mistaken. Adding -DCMAKE_C*_FLAGS_MACPORTS definitions has no effect, nor has setting CMAKE_C*_FLAGS from the CMake command line. Which leads me to the following questions: - Is it indeed possible to get CMake to take all compiler and linker flags from the environment, and if so, how? - If not, what is the best/official way to get exact control over the compiler and linker options used? - Out of curiosity, what's special about the CMAKE_BUILD_TYPE=Debian build type? Thanks René Bertin -- 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