Patchwork cmake.bbclass: adding extendable extra variable to root path

login
register
mail settings
Submitter Andrew Gabbasov
Date Sept. 28, 2011, 12:10 p.m.
Message ID <4E830EA4.5050002@mentor.com>
Download mbox | patch
Permalink /patch/12343/
State New, archived
Headers show

Comments

Andrew Gabbasov - Sept. 28, 2011, 12:10 p.m.
Introducing a hook variable for various .conf files to add
extra path elements to cmake. For example, it can be used
in external toolchain conf file to add ${TOOLCHAIN_PATH}
to cmake root path search.

Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
---
 meta/classes/cmake.bbclass |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Otavio Salvador - Sept. 28, 2011, 1:07 p.m.
On Wed, Sep 28, 2011 at 09:10, Andrew Gabbasov
<andrew_gabbasov@mentor.com> wrote:
> Introducing a hook variable for various .conf files to add
> extra path elements to cmake. For example, it can be used
> in external toolchain conf file to add ${TOOLCHAIN_PATH}
> to cmake root path search.
>
> Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>

Acked-by: Otavio Salvador <otavio@ossystems.com.br>

Patch

diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass
index ab23bed..432427e 100644
--- a/meta/classes/cmake.bbclass
+++ b/meta/classes/cmake.bbclass
@@ -26,6 +26,7 @@  OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CXXFLAGS} -DNDEBUG"
 
 OECMAKE_RPATH ?= ""
 OECMAKE_PERLNATIVE_DIR ??= ""
+OECMAKE_EXTRA_ROOT_PATH ?= ""
 
 cmake_do_generate_toolchain_file() {
 	cat > ${WORKDIR}/toolchain.cmake <<EOF
@@ -42,7 +43,7 @@  set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLA
 
 # 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})
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR} ${OECMAKE_EXTRA_ROOT_PATH} )
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )