Skip to contentSkip to conversation

cmake.bbclass, perlnative.bbclass: arrange for cmake to find perl-native

PATCH Applied Phil Blundell 2 participants 3 messages Aug 15, 2011 – Aug 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmake.bbclass, perlnative.bbclass: arrange for cmake to find perl-native

When CMake is looking for perl, it only searches in the specific directories that it's told about and ignores ${PATH}. If perlnative is in use, ensure that the appropriate installation path is added to the list of places that cmake will look for perl, otherwise it won't ever be found.

---
 meta/classes/cmake.bbclass      |    3 ++-
 meta/classes/perlnative.bbclass |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
meta/classes/cmake.bbclass +2 -1
index 89a154f..ab23bed 100644
@@ -25,6 +25,7 @@ OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CPPFLAGS} -DNDEBUG"
 OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CXXFLAGS} -DNDEBUG"
 
 OECMAKE_RPATH ?= ""
+OECMAKE_PERLNATIVE_DIR ??= ""
 
 cmake_do_generate_toolchain_file() {
 	cat > ${WORKDIR}/toolchain.cmake <<EOF
@@ -41,7 +42,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} )
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR})
 set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
 set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
meta/classes/perlnative.bbclass +1 -0
index 522344d..2211b72 100644
@@ -1,2 +1,3 @@
 PATH_prepend = "${STAGING_BINDIR_NATIVE}/perl-native:"
 DEPENDS += "perl-native"
+OECMAKE_PERLNATIVE_DIR = "${STAGING_BINDIR_NATIVE}/perl-native"
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 10 lines · Phil Blundell

When CMake is looking for perl, it only searches in the specific directories that it's told about and ignores ${PATH}. If perlnative is in use, ensure that the appropriate installation path is added to the list of places that cmake will look for perl, otherwise it won't ever be found.

---
 meta/classes/cmake.bbclass      |    3 ++-
 meta/classes/perlnative.bbclass |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)

This is not very pretty, but then I guess nothing to do with cmake ever is. Better suggestions for how to make this work are of course welcome.

p.

Applied
#2 lore raw
In reply to Phil Blundell
Quoted 37 lines · Phil Blundell

When CMake is looking for perl, it only searches in the specific directories that it's told about and ignores ${PATH}. If perlnative is in use, ensure that the appropriate installation path is added to the list of places that cmake will look for perl, otherwise it won't ever be found.

---
  meta/classes/cmake.bbclass      |    3 ++-
  meta/classes/perlnative.bbclass |    1 +
  2 files changed, 3 insertions(+), 1 deletions(-)
meta/classes/cmake.bbclass +2 -1
index 89a154f..ab23bed 100644
@@ -25,6 +25,7 @@ OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CPPFLAGS} -DNDEBUG"
  OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} ${CXXFLAGS} -DNDEBUG"
 
  OECMAKE_RPATH ?= ""
+OECMAKE_PERLNATIVE_DIR ??= ""
 
  cmake_do_generate_toolchain_file() {
  	cat>  ${WORKDIR}/toolchain.cmake<<EOF
@@ -41,7 +42,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} )
+set( CMAKE_FIND_ROOT_PATH ${STAGING_DIR_HOST} ${STAGING_DIR_NATIVE} ${CROSS_DIR} ${OECMAKE_PERLNATIVE_DIR})
  set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY )
  set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY )
  set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
meta/classes/perlnative.bbclass +0 -0
index 522344d..2211b72 100644

meta/classes/perlnative.bbclass line 3

Quoted 3 lines
meta/classes/perlnative.bbclass +1 -0
@@ -1,2 +1,3 @@
  PATH_prepend = "${STAGING_BINDIR_NATIVE}/perl-native:"
  DEPENDS += "perl-native"
+OECMAKE_PERLNATIVE_DIR = "${STAGING_BINDIR_NATIVE}/perl-native"

Merged to OE-Core

Thanks
Sau!