[CMake] One project, one platform, 2 compilers

Paul Hansen paul.hansen.name at gmail.com
Thu Nov 17 11:18:37 EST 2011


Hi

I have a project that has to be compiled with two different compilers on
the same computer.

Can I do that from the same CMakeLists.txt file?

Specifically I am wondering:
- CMake finds a compiler and makes a test. A colleague has tried to change
the compiler variables but CMake made the test and overwrote his settings
(from the CMakeLists.txt file) in CMakeCache.txt
- With target_link_directories I can point out specifically which libraries
should be used with each executable. But what about header files?
include_directories() is not specified for each executable. Is there anyway
to control what is in the include path at different points in the
CMakeLists.txt. I have tried to use set_directory_properties(PROPERTIES
INCLUDE_DIRECTORIES "") to reset include path at one point. The deletion
works but just not at that specific point on CMakeLists.txt.
- If split up into compiler1.cmake and compiler2.cmake I still get the
include_directories() problem since values are "inherited"

Thank you very much indeed
Paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111117/3ae36d20/attachment.htm>


More information about the CMake mailing list