diff options
author | Michael Ho <Michael.Ho@bmw.de> | 2019-08-14 17:05:15 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-10-23 16:30:35 +0100 |
commit | dbba06d9153ae588c9496b40e5db18b3602bfad1 (patch) | |
tree | ded35a353de35b7ac09c2c5216552ea7e6328ef5 | |
parent | 88a4e3cd31e4e8cc2c77037d065121f8074fa66e (diff) | |
download | poky-dbba06d9153ae588c9496b40e5db18b3602bfad1.tar.gz |
cmake.bbclass: add HOSTTOOLS_DIR to CMAKE_FIND_ROOT_PATH
The find_program command will fail if it is used on a tool that is listed in
ASSUME_PROVIDED. This is because these tools are in the hosttools directory
which is not listed in CMAKE_FIND_ROOT_PATH so cmake will not find them.
Adding the directory HOSTTOOLS_DIR to the CMAKE_FIND_ROOT_PATH variable fixes
the initial issue of needing to search for tools in ASSUME_PROVIDED.
Note that this change alone does not fix the issue because find_program will
by default only look into the subdirectories bin and usr/bin under the paths
in CMAKE_FIND_ROOT_PATH to find the programs and the hosttools directory has
instead the symlinks directly present without these subdirectories.
Set CMAKE_PROGRAM_PATH to by default include the root directory so
find_program can search the hosttools directory without needing the prefix
directories.
(From OE-Core rev: 7847f431cd8db59fce8c9401a603c4b0678ee16d)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/cmake.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index 2b317c832f..291f1e8d44 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass | |||
@@ -106,11 +106,12 @@ set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" ) | |||
106 | 106 | ||
107 | # only search in the paths provided so cmake doesnt pick | 107 | # only search in the paths provided so cmake doesnt pick |
108 | # up libraries and tools from the native build machine | 108 | # up libraries and tools from the native build machine |
109 | set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN}) | 109 | set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN} ${HOSTTOOLS_DIR}) |
110 | set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) | 110 | set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY ) |
111 | set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} ) | 111 | set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ${OECMAKE_FIND_ROOT_PATH_MODE_PROGRAM} ) |
112 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | 112 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) |
113 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) | 113 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) |
114 | set( CMAKE_PROGRAM_PATH "/" ) | ||
114 | 115 | ||
115 | # Use qt.conf settings | 116 | # Use qt.conf settings |
116 | set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) | 117 | set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) |