Skip to contentSkip to conversation

cmake: also set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE

PATCH In review Ross Burton 2 participants 2 messages Oct 11, 2016 – Oct 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmake: also set CMAKE_FIND_ROOT_PATH_MODE_PACKAGE

The other CMAKE_FIND_ROOT_PATH_MODE_* variables were already set to ONLY, but PACKAGE was left out. Fix this so that cmake doesn't look on the host for cmake modules when it should only be looking in the target sysroot.

---
 meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +2 -0
index 60014bb..0ce6573 100644
@@ -3,10 +3,12 @@ set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE )
 set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS}  CACHE STRING "" FORCE )
 set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE )
 set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE )
+
 set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} )
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY )
 
 string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT})
 string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR})
Signature · 1 line
2.8.1
Acked-by Tested-by on v1 1/1
#1 lore raw
Quoted 5 lines · Ross Burton

The other CMAKE_FIND_ROOT_PATH_MODE_* variables were already set to ONLY, but PACKAGE was left out. Fix this so that cmake doesn't look on the host for cmake modules when it should only be looking in the target sysroot.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750