toolchainfile.cmake: only search the sysroot for CMake module
authorSamuel Martin <s.martin49@gmail.com>
Sun, 8 Mar 2015 09:47:22 +0000 (10:47 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 16 Mar 2015 21:16:45 +0000 (22:16 +0100)
This change prevents CMake from searching outside the sysroot location
for CMake modules when cross-compiling.

Signed-off-by: Samuel Martin <s.martin49@gmail.com>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
support/misc/toolchainfile.cmake.in

index 816af1331a1ebb558a6548caf3c8b89fbe8b4337..cd412542e5e81a9868744df9d30fc0e5f607a0b0 100644 (file)
@@ -21,6 +21,7 @@ set(CMAKE_INSTALL_SO_NO_EXE 0)
 set(CMAKE_PROGRAM_PATH "${RELOCATED_HOST_DIR}/usr/bin")
 set(CMAKE_FIND_ROOT_PATH "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")
 set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
 set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
 set(ENV{PKG_CONFIG_SYSROOT_DIR} "${RELOCATED_HOST_DIR}/@@STAGING_SUBDIR@@")