]> code.ossystems Code Review - openembedded-core.git/commit
cmake.bbclass: add HOSTTOOLS_DIR to CMAKE_FIND_ROOT_PATH
authorMichael Ho <Michael.Ho@bmw.de>
Wed, 14 Aug 2019 15:05:15 +0000 (17:05 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 22 Oct 2019 07:48:16 +0000 (08:48 +0100)
commit4bb5778531d547fcbc8ed24689c4e8dea836d514
treef6ac0cea10f4abe7cbf2ec8d288761597b215114
parent603a4fa2167a4654e50fdef106a6fd512ee0dd56
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.

Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/cmake.bbclass