Provide additional OECORE_EXTRA_SYSROOT variable for CMake Toolchain
PATCH 1/1 Provide additional OECORE_EXTRA_SYSROOT variable for CMake Toolchain
Hey, I would like to propose the appended patch for Poky's CMake toolchain to allow its usage inside a Yocto SDK for building libraries and applications using an external (meaning as in "different to the native SDK dir") install directory.
I hope that I use the correct mailing list and patch format. (It's my first patch to Yocto) Please tell me if this mail is better suited for a different mailing list.
Cheers,
Andreas
From b09bc09c13d1ec9334bdc8a2c148436f1f363b71 Mon Sep 17 00:00:00 2001
From: Andreas Cord-Landwehr <[email protected]>
Date: Mon, 26 Dec 2016 13:43:02 +0100
Subject: [PATCH] Provide additional OECORE_EXTRA_SYSROOT variable
When compiling against a Yocto generated SDK and using an install folder outside of the SDK's folder, CMake must be configure by using the respective CMAKE_FIND_ROOT_PATH. This CMake cache variable is set in the toolchain file and hence can only be configured via environment variables; unless one wants to modify a project's CMake files.
This patch adds an additional environment variable OECORE_EXTRA_SYSROOT to specify such an additional sysroot location that can optionally be used when building against a Yocto SDK using this toolchain file.
--- meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
meta/recipes-devtools/cmake/cmake/OEToolchainConfig.cmake +4 -1
@@ -4,7 +4,10 @@ set( CMAKE_CXX_FLAGS $ENV{CXXFLAGS} CACHE STRING "" FORCE ) set( CMAKE ASM_FLAGS ${CMAKE_C_FLAGS} CACHE STRING "" FORCE ) set( CMAKE_LDFLAGS_FLAGS ${CMAKE_CXX_FLAGS} CACHE STRING "" FORCE ) -set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} ) +# Re-root CMake search tree to sysroot locations given by environment variables OECORE_TARGET_SYSROOT and +# OECORE_NATIVE_SYSROOT. For additional locations, e.g. a cross-building install directory, use +# the OECORE_EXTRA_SYSROOT variable. +set( CMAKE_FIND_ROOT_PATH $ENV{OECORE_TARGET_SYSROOT} $ENV{OECORE_NATIVE_SYSROOT} $ENV{OECORE_EXTRA_SYSROOT} ) set( CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER ) set( CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY ) set( CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY )
Signature · 1 line
2.11.0
Hi, since it's roughly two weeks, I just wanted to bump this patch again (yes, I know many people were on vacations).
But actually, I would already be glad to hear whether I sent the patch to the right list.
Cheers,
Andreas
Quoted 11 lines · CET Andreas Cord-Landwehr
Hey, I would like to propose the appended patch for Poky's CMake toolchain to allow its usage inside a Yocto SDK for building libraries and applications using an external (meaning as in "different to the native SDK dir") install directory.
I hope that I use the correct mailing list and patch format. (It's my first patch to Yocto) Please tell me if this mail is better suited for a different mailing list.
Cheers,
Andreas
Quoted 7 lines · Andreas Cord-Landwehr
Hi, since it's roughly two weeks, I just wanted to bump this patch again (yes,
I know many people were on vacations).
But actually, I would already be glad to hear whether I sent the patch to the
right list.
The correct list would be [email protected], and if possible please send the patch with git-send-email (or similar) for easier reviewing.
Ross