[CMake] Merging gcc unit tests into a TI DSP crosscompiler build system
Alexander Neundorf
a.neundorf-work at gmx.net
Mon Nov 8 15:13:36 EST 2010
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
More information about the CMake
mailing list