LaMontagne
LaMontagne

Reputation: 11

CMake: Cross-compilation with two different compilers but same source

I want to use CMake to generate two different Makefiles, one for Unittests running on the host compiled with GCC and one for an embedded target (arm) compiled with the IAR compiler. The same source tree is used for both targets (excluding some files).

As far as I understand, only one compiler can be used per CMakeLists.txt. Is it possible to have two CMakeLists.txt in the same source directory?

Upvotes: 1

Views: 781

Answers (1)

arrowd
arrowd

Reputation: 34401

Only one compiler can be used per CMakeCache.txt, that is per a build dir. Just use two different build dirs for different compilers.

Upvotes: 4

Related Questions