summaryrefslogtreecommitdiffstats
path: root/scripts/lib/ptxd_make_cmake_toolchain.sh
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-01-23 22:59:53 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-01-23 23:00:31 +0100
commit08fd9eb2f00b600e1951f34d6a9faf840355e491 (patch)
tree2a4158efb580560b3f584512c9d4d3512c441005 /scripts/lib/ptxd_make_cmake_toolchain.sh
parent608f8974179bef0cde9ce4e0f865996923ae40a6 (diff)
downloadptxdist-08fd9eb2f00b600e1951f34d6a9faf840355e491.tar.gz
ptxdist-08fd9eb2f00b600e1951f34d6a9faf840355e491.tar.xz
[toolchain-target.cmake] add include_ and link_directories
There are several cmake based packages out there that use CHECK_INCLUDE_FILES to find include files. The problem is, that cmake only looks in the implizid search directories, but not in the additional ones. Even if CMAKE_FIND_ROOT_PATH is defined and points to them. Further cmake doesn't care about "-I" or "-isystem" in CPPFLAGS. Our solution (I'm not into cmake, but I think it's a hacky one): define: - include_directories - link_directories This has one drawback for linking. cmake thinks the paths specified in link_directories are "implicid" linker search path. But they aren't. Fortunately cmake cares about '-L' in LDFLAGS so it links in the end. :P Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'scripts/lib/ptxd_make_cmake_toolchain.sh')
-rw-r--r--scripts/lib/ptxd_make_cmake_toolchain.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_cmake_toolchain.sh b/scripts/lib/ptxd_make_cmake_toolchain.sh
index 68b38759f..17129341e 100644
--- a/scripts/lib/ptxd_make_cmake_toolchain.sh
+++ b/scripts/lib/ptxd_make_cmake_toolchain.sh
@@ -22,6 +22,8 @@ export PTXDIST_CMAKE_TOOLCHAIN_HOST
# FIXME: take care about non linux
#
ptxd_make_cmake_toolchain_target() {
+ local sysroot_prefix="${PTXDIST_PATH_SYSROOT_PREFIX}:"
+
SYSTEM_NAME="Linux" \
SYSTEM_VERSION="1" \
\
@@ -29,6 +31,8 @@ ptxd_make_cmake_toolchain_target() {
CXX="$(which "${CXX}")" \
\
SYSROOT="${PTXDIST_PATH_SYSROOT_ALL//:/ }" \
+ INCLUDE_DIRECTORIES="${sysroot_prefix//://include }" \
+ LINK_DIRECTORIES="${sysroot_prefix//://lib }" \
\
ptxd_replace_magic "${PTXDIST_TOPDIR}/config/cmake/toolchain-target.cmake.in" > "${1}"
}