[OE-core] [PATCH] cmake.bbclass: allow searching host paths for non-target builds
Jonathan Liu
net147 at gmail.com
Wed Jul 17 05:40:34 UTC 2013
This allows /usr/bin/{ld,ar,objcopy,objdump,ranlib,strip} to be found
and the CMAKE_{LINKER,AR,OBJCOPY,OBJDUMP,RANLIB,STRIP} cmake variables
to be properly set for native cmake recipes.
Signed-off-by: Jonathan Liu <net147 at gmail.com>
---
meta/classes/cmake.bbclass | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index 310242e..7084bed 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -46,12 +46,7 @@ set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLA
set( CMAKE_C_LINK_FLAGS "${OECMAKE_C_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
set( CMAKE_CXX_LINK_FLAGS "${OECMAKE_CXX_LINK_FLAGS}" CACHE STRING "LDFLAGS" )
-# only search in the paths provided so cmake doesnt pick
-# up libraries and tools from the native build machine
set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} ${EXTERNAL_TOOLCHAIN})
-set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
-set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
-set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
# Use qt.conf settings
set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf )
@@ -69,6 +64,16 @@ set( CMAKE_LIBRARY_PATH ${libdir} ${base_libdir})
EOF
}
+cmake_do_generate_toolchain_file_class-target() {
+ cat >> ${WORKDIR}/toolchain.cmake <<EOF
+# only search in the paths provided so cmake doesnt pick
+# up libraries and tools from the native build machine
+set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
+set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
+EOF
+}
+
addtask generate_toolchain_file after do_patch before do_configure
cmake_do_configure() {
--
1.8.3.2
More information about the Openembedded-core
mailing list