On Monday 08 November 2010, Wojciech Migda wrote: > Hi, > > in our company we have a robust cmake-based build system which utilizes TI > DSP cgtools compiler. Aside from that we are developing gcc-based unit > tests (CxxTest coupled with CMake/CTest/CDash combo). We are considering > merging the latter into the former, but we kind of don't even know how to > put them together so that two C/C++ compilers can coexist in a single CMake > build system. I tried inserting ADD_SUBDIRECTORY pointing to one of the > test suites CMakeLists.txt file into the main CMakeLists.txt of the core > build system but it blows everything up. > > Has anyone attempted this kind of configuration already ? Is it achievable > with CMake at all ?
It is probably possible, but it's a hack. In general, you can only have one compiler per language in one cmake build tree. Among other because the results of configure checks are compiler-specific, and they are saved in the global cache, so you can't have multiple correct values. What can be done, is to change the CMAKE_C_COMPILER etc. variables in a subdir, then those changed settings will be used there. If you use additional stuff like find_package() etc. you must be sure you know what you are doing, so that it doesn't conflict with other (global) cache variables in your project. Alex _______________________________________________ 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