[CMake] specifying two (cross)compilers

Arne Pagel arne at pagelnet.de
Thu Nov 24 14:33:12 EST 2011


Hello everyone,

I have a  project (for embedded controllers) where I have to use 2 different compilers for 2 targets.

The output of the first target is included in to the elf-output of the second one.
src_1/* -> 1.elf
src_2/* -> 2.elf + 1.elf

Currently I use this procedure with a hand written makefile, and now I want to switch to cmake, but 
I don't know how to specify a second compiler in camke. (I think both compilers have to be forced).

I can use one major CmakeLists.txt and creating subprojects, which each of its own CMakelists.txt, 
but then I have no dependency, (src_2 just can be build when src_1 is has finished).
I also want, that if I just modify src_1 (and I call make just from that source) src_2 is rebuild 
afterwards.

Any Idea what might be the best solution for that?





More information about the CMake mailing list