diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2011-05-08 17:45:39 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-05-11 16:41:52 +0100 |
commit | 9c272d93c68cf40de300f9bf4b51eae5116178e2 (patch) | |
tree | 9453837ff239f180048201706c1d5b1ec7a6189e /meta | |
parent | 37f431985055a6a2ab7ac753c188057abfaa4fc5 (diff) | |
download | poky-9c272d93c68cf40de300f9bf4b51eae5116178e2.tar.gz |
cmake.bbclass: fix qmake and rpath issues
Sync with OE at 3b7d83362027fde4f6850533ab83277d95dda961 however
without changing the way of generating the toolchain file and making
it branding agnostic.
(From OE-Core rev: ee98c2b095b991901b6c2125b2428985c873b4bd)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/cmake.bbclass | 14 | ||||
-rw-r--r-- | meta/classes/native.bbclass | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/meta/classes/cmake.bbclass b/meta/classes/cmake.bbclass index a4b0c126a2..011c2324c8 100644 --- a/meta/classes/cmake.bbclass +++ b/meta/classes/cmake.bbclass | |||
@@ -24,15 +24,18 @@ OECMAKE_CXX_FLAGS ?= "${HOST_CC_ARCH} ${TOOLCHAIN_OPTIONS} ${TARGET_CPPFLAGS} -f | |||
24 | OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG" | 24 | OECMAKE_C_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG" |
25 | OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG" | 25 | OECMAKE_CXX_FLAGS_RELEASE ?= "${SELECTED_OPTIMIZATION} -DNDEBUG" |
26 | 26 | ||
27 | OECMAKE_RPATH ?= "" | ||
28 | |||
27 | cmake_do_generate_toolchain_file() { | 29 | cmake_do_generate_toolchain_file() { |
28 | cat > ${WORKDIR}/toolchain.cmake <<EOF | 30 | cat > ${WORKDIR}/toolchain.cmake <<EOF |
29 | # CMake system name must be something like "Linux". | 31 | # CMake system name must be something like "Linux". |
30 | # This is important for cross-compiling. | 32 | # This is important for cross-compiling. |
31 | set( CMAKE_SYSTEM_NAME `echo ${SDK_OS} | sed 's/^./\u&/'` ) | 33 | set( CMAKE_SYSTEM_NAME `echo ${SDK_OS} | sed 's/^./\u&/'` ) |
34 | set( CMAKE_SYSTEM_PROCESSOR ${TARGET_ARCH} ) | ||
32 | set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) | 35 | set( CMAKE_C_COMPILER ${OECMAKE_C_COMPILER} ) |
33 | set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} ) | 36 | set( CMAKE_CXX_COMPILER ${OECMAKE_CXX_COMPILER} ) |
34 | set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "poky CFLAGS" ) | 37 | set( CMAKE_C_FLAGS "${OECMAKE_C_FLAGS}" CACHE STRING "CFLAGS" ) |
35 | set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "poky CXXFLAGS" ) | 38 | set( CMAKE_CXX_FLAGS "${OECMAKE_CXX_FLAGS}" CACHE STRING "CXXFLAGS" ) |
36 | set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "CFLAGS for release" ) | 39 | set( CMAKE_C_FLAGS_RELEASE "${OECMAKE_C_FLAGS_RELEASE}" CACHE STRING "CFLAGS for release" ) |
37 | set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLAGS for release" ) | 40 | set( CMAKE_CXX_FLAGS_RELEASE "${OECMAKE_CXX_FLAGS_RELEASE}" CACHE STRING "CXXFLAGS for release" ) |
38 | 41 | ||
@@ -43,6 +46,13 @@ set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY ) | |||
43 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | 46 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) |
44 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) | 47 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) |
45 | 48 | ||
49 | # Use qt.conf settings | ||
50 | set( ENV{QT_CONF_PATH} ${WORKDIR}/qt.conf ) | ||
51 | |||
52 | # We need to set the rpath to the correct directory as cmake does not provide any | ||
53 | # directory as rpath by default | ||
54 | set( CMAKE_INSTALL_RPATH ${OECMAKE_RPATH} ) | ||
55 | |||
46 | # Use native cmake modules | 56 | # Use native cmake modules |
47 | set( CMAKE_MODULE_PATH ${STAGING_DATADIR}/cmake/Modules/ ) | 57 | set( CMAKE_MODULE_PATH ${STAGING_DATADIR}/cmake/Modules/ ) |
48 | EOF | 58 | EOF |
diff --git a/meta/classes/native.bbclass b/meta/classes/native.bbclass index d9e67f6908..e06f02a1bf 100644 --- a/meta/classes/native.bbclass +++ b/meta/classes/native.bbclass | |||
@@ -11,6 +11,10 @@ PACKAGES_DYNAMIC = "" | |||
11 | PACKAGES_DYNAMIC_virtclass-native = "" | 11 | PACKAGES_DYNAMIC_virtclass-native = "" |
12 | PACKAGE_ARCH = "${BUILD_ARCH}" | 12 | PACKAGE_ARCH = "${BUILD_ARCH}" |
13 | 13 | ||
14 | # used by cmake class | ||
15 | OECMAKE_RPATH = "${libdir}" | ||
16 | OECMAKE_RPATH_virtclass-native = "${libdir}" | ||
17 | |||
14 | BASE_PACKAGE_ARCH = "${BUILD_ARCH}" | 18 | BASE_PACKAGE_ARCH = "${BUILD_ARCH}" |
15 | BASEPKG_HOST_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}" | 19 | BASEPKG_HOST_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}" |
16 | BASEPKG_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}" | 20 | BASEPKG_TARGET_SYS = "${BUILD_ARCH}${BUILD_VENDOR}-${BUILD_OS}" |