[CMake] Overriding imported project [CMakeImportBuildSettings.cmake]
Mathieu Malaterre
mathieu.malaterre at gmail.com
Tue Aug 21 05:30:28 EDT 2007
Hello,
As cmake become more and more popular we can see more cmake packaged
project. One issue I am having right now is that I cannot finely
control a feature of CMake. I'd like to be able to override the import
of compiler options.
For instance I have a package (let say VTK) which define:
SET(CMAKE_BUILD_SETTING_CXX_COMPILER "c++")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS "")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_DEBUG "-g")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELEASE "-O3")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_MINSIZEREL "-Os")
SET(CMAKE_BUILD_SETTING_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
Unless I do the correct symlink of c++ to the compiler I choose (let
say g++-4.2) cmake will not allow me to do so. Same goes for RELEASE
flag, in older cmake release -DNDEBUG was not part of the Release
flag...
Here is the patch I am currently using (see cmake.patch). Advanced
user who knows that a certain compiler is compatible with another one
can set: CMAKE_OVERRIDE_COMPILER_MISMATCH. By default the old behavior
should be the same.
Thanks for comments,
--
Mathieu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cmake.patch
Type: text/x-patch
Size: 8000 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070821/77ea3c39/cmake-0001.bin
More information about the CMake
mailing list