diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2014-10-20 23:58:52 -0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-10-24 21:59:46 +0100 |
commit | dacc4ce59e48129a1a1e5316e10780f7358e29ef (patch) | |
tree | 6965b4f3ff6389a9e4edc5405753abd773204a4f /meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | |
parent | ce339dde32b7553cba9029c161098a090c4281de (diff) | |
download | poky-dacc4ce59e48129a1a1e5316e10780f7358e29ef.tar.gz |
nativesdk-cmake: Adjust toolchain paths dynamically
This patch adds a flexible way to configure the CMake in SDKs. It adds
a toolchain configuration script which supports subscripts for
extensions, as for example Qt5.
(From OE-Core rev: 4143f3b0ce0d0c52f5b0babc1bb16ac0ac9610eb)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake')
-rw-r--r-- | meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake new file mode 100644 index 0000000000..60014bbf2b --- /dev/null +++ b/meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | |||
@@ -0,0 +1,18 @@ | |||
1 | set( CMAKE_SYSTEM_NAME Linux ) | ||
2 | set( CMAKE_C_FLAGS $ENV{CFLAGS} CACHE STRING "" FORCE ) | ||
3 | set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) | ||
4 | set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) | ||
5 | set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) | ||
6 | set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} ) | ||
7 | set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) | ||
8 | set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) | ||
9 | set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY ) | ||
10 | |||
11 | string(REGEX MATCH "sysroots/([a-zA-Z0-9]+)" CMAKE_SYSTEM_PROCESSOR $ENV{SDKTARGETSYSROOT}) | ||
12 | string(REGEX REPLACE "sysroots/" "" CMAKE_SYSTEM_PROCESSOR ${CMAKE_SYSTEM_PROCESSOR}) | ||
13 | |||
14 | # Include the toolchain configuration subscripts | ||
15 | file( GLOB toolchain_config_files "${CMAKE_TOOLCHAIN_FILE}.d/*.cmake" ) | ||
16 | foreach(config ${toolchain_config_files}) | ||
17 | include(${config}) | ||
18 | endforeach() | ||