From 08fd9eb2f00b600e1951f34d6a9faf840355e491 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Sat, 23 Jan 2010 22:59:53 +0100 Subject: [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 --- scripts/lib/ptxd_make_cmake_toolchain.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'scripts/lib/ptxd_make_cmake_toolchain.sh') 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}" } -- cgit v1.2.3