diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-11-09 22:47:21 +0100 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2017-11-10 19:19:40 +0100 |
commit | 9f8b8f3b4bc84a59047ac44590ec40d4aa11cb29 (patch) | |
tree | 0211cb8c791c179e086ff7f0aef7ecfa4ed4b4ea /config | |
parent | 87d2a8242dac4ec76cb520b1fef2f193c22e52dc (diff) | |
download | ptxdist-9f8b8f3b4bc84a59047ac44590ec40d4aa11cb29.tar.gz ptxdist-9f8b8f3b4bc84a59047ac44590ec40d4aa11cb29.tar.xz |
toolchain-*.cmake: improve search path handling
The toolchain wrappers add the search directories to the compiler command
line. Mark them as implicit directories, so that cmake won't add them
again. This prevents problems caused by an unexpected search order.
Without this building the poppler qt5 wrapper may fail if qt4 is install
into sysroot-target.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'config')
-rw-r--r-- | config/cmake/toolchain-host.cmake.in | 5 | ||||
-rw-r--r-- | config/cmake/toolchain-target.cmake.in | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/config/cmake/toolchain-host.cmake.in b/config/cmake/toolchain-host.cmake.in index 9c9c6b644..daf71d857 100644 --- a/config/cmake/toolchain-host.cmake.in +++ b/config/cmake/toolchain-host.cmake.in @@ -9,3 +9,8 @@ SET(CMAKE_BUILD_WITH_INSTALL_RPATH True) SET(CMAKE_PREFIX_PATH @PREFIX_PATH@) include_directories( @INCLUDE_DIRECTORIES@) link_directories( @LINK_DIRECTORIES@) + +# toolchain wrappers handle the search directories implicitly +LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES @INCLUDE_DIRECTORIES@) +LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES @INCLUDE_DIRECTORIES@) +LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES @LINK_DIRECTORIES@) diff --git a/config/cmake/toolchain-target.cmake.in b/config/cmake/toolchain-target.cmake.in index d316db52c..cba2aaba4 100644 --- a/config/cmake/toolchain-target.cmake.in +++ b/config/cmake/toolchain-target.cmake.in @@ -20,9 +20,15 @@ SET(CMAKE_FIND_ROOT_PATH @SYSROOT@) include_directories( @INCLUDE_DIRECTORIES@) link_directories( @LINK_DIRECTORIES@) +# toolchain wrappers handle the search directories implicitly +LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES @INCLUDE_DIRECTORIES@) +LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES @INCLUDE_DIRECTORIES@) +LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES @LINK_DIRECTORIES@) + # search for programs in the build host directories SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # for libraries and headers in the target directories SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) |