[CMake] using toolchain files on a host system

Alexander Oh oh.a at gmx.at
Mon Apr 8 17:22:21 EDT 2013


I'm successfully running cmake as a build-system for an embedded
application. The firmware also runs on x86 and thanks to toolchain files
it's possible to separate system configuration from building.

I've got one issue though:

When setting CMAKE_FIND_ROOT and CMAKE_FIND_ROOT_PATH_MODE_LIBRARY and,
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE to BOTH it's impossible to give one
path precedence over the other(ROOT_PATH first  or system path first).

Is there another way to find the right libraries without using custom
FindXXX.cmake files in a CMakeModules path?
I can workaround some of the libraries like boost by looking for exact
versions, but this shouldn't be the way to find your libraries. It would
be nicer to to be able to set CMAKE_FIND_ROOT_PATH_MODE_INCLUDE to
something similar to PREFER_SYSTEM or PREFER_ROOT_PATH.

What do you think about it?
Where do you think it should be implemented?
And how much effort would that be?

Kind regards,
Alex


More information about the CMake mailing list