diff options
author | Harald Sitter <sitter@kde.org> | 2017-03-28 14:51:19 +0200 |
---|---|---|
committer | Harald Sitter <sitter@kde.org> | 2017-03-29 17:10:01 +0200 |
commit | 4468076a41f947dd8cfa2b3bd4c2cb762f614aa2 (patch) | |
tree | bf19d5e63df7bc66ed3ca40201f2ec40206fd52c | |
parent | e1fd748982dc5c335aa66766c62aa4e4d5d1bc6c (diff) | |
download | kconfig-4468076a41f947dd8cfa2b3bd4c2cb762f614aa2.tar.gz kconfig-4468076a41f947dd8cfa2b3bd4c2cb762f614aa2.tar.bz2 |
explicitly set NO_CMAKE_FIND_ROOT_PATH
Summary:
When using a toolchain file one often would want to set a
CMAKE_FIND_ROOT_PATH to "re-root" lookups into a staging area to prevent
native host artifcats from being found. This in particular is usually the
case for lib/include/package finders as one would want the target
systems build artifacts rather than the hosts.
find_file() unfortunately draws its re-rooting rule from
CMAKE_FIND_ROOT_PATH_MODE_INCLUDE, which as mentioned would usually be
set not to look in the actual host paths to avoid picking up wrong includes
which would also prevent find_file to work here.
In the case of the coreaddonstooling it makes sense to look in the host
though. For one the lookup only runs when CROSS_COMPILING is set (which
usually is the case for toolchains), AND one explicitly has to specify a
HOST_TOOLING path. So in a way by specifying that one is already opting
out of whatever rooting rules one has set elsewhere as setting that var
is a clear indication that we have *specific* host tooling and we want
to use that rather than anything else.
As a result NO_CMAKE_FIND_ROOT_PATH is the way to go when looking for stuff
under a KF5_HOST_TOOLING conditional.
Reviewers: mdawson, apol
Reviewed By: apol
Subscribers: #frameworks
Tags: #frameworks
Differential Revision: https://phabricator.kde.org/D5218
-rw-r--r-- | KF5ConfigConfig.cmake.in | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/KF5ConfigConfig.cmake.in b/KF5ConfigConfig.cmake.in index 22d0ed5b..d434c88e 100644 --- a/KF5ConfigConfig.cmake.in +++ b/KF5ConfigConfig.cmake.in @@ -8,7 +8,10 @@ include(CMakeFindDependencyMacro) find_dependency(Qt5Xml "@REQUIRED_QT_VERSION@") if(CMAKE_CROSSCOMPILING AND KF5_HOST_TOOLING) - find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} NO_DEFAULT_PATH) + find_file(KCONFIGCOMPILER_PATH KF5Config/KF5ConfigCompilerTargets.cmake + PATHS ${KF5_HOST_TOOLING} ${CMAKE_CURRENT_LIST_DIR} + NO_DEFAULT_PATH + NO_CMAKE_FIND_ROOT_PATH) include("${KCONFIGCOMPILER_PATH}") else() include("${CMAKE_CURRENT_LIST_DIR}/KF5ConfigCompilerTargets.cmake") |