diff options
author | Christian Fetzer <fetzer.ch@gmail.com> | 2016-08-07 09:40:13 +0200 |
---|---|---|
committer | Christian Fetzer <fetzer.ch@gmail.com> | 2016-08-09 23:27:09 +0200 |
commit | 190f76f0642be972313afa179f3d158314a9e77f (patch) | |
tree | 783f1e943f2cbbddd6cf29fe858a037dae86f19a /tools/depends/target | |
parent | b6f74c3878dc6b91283bd581945209678838fdcd (diff) |
[depends/rbpi] Prevent CMake from using /usr prefix
On the Raspberry Pi `use_sdk_path` and `use_toolchain` expands to empty
variables and `/usr` (and others) end up being used in
`CMAKE_FIND_ROOT_PATH` and `CMAKE_LIBRARY_PATH`.
Since the depends path has higher priority, this only affects
dependencies that were not found (but are used on other platforms).
This fixes warning messages such as:
-- Could NOT find PulseAudio: Found unsuitable version "1.1.0", but
required is at least "2.0.0" (found PULSEAUDIO_LIBRARY-NOTFOUND)
-- Could NOT find VAAPI: Found unsuitable version "0.32.0", but
required is at least "0.38.0" (found VAAPI_libva_LIBRARY-NOTFOUND)
Diffstat (limited to 'tools/depends/target')
-rw-r--r-- | tools/depends/target/Toolchain.cmake.in | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tools/depends/target/Toolchain.cmake.in b/tools/depends/target/Toolchain.cmake.in index 7b32712c4d..7f86d8b002 100644 --- a/tools/depends/target/Toolchain.cmake.in +++ b/tools/depends/target/Toolchain.cmake.in @@ -31,9 +31,16 @@ set(CMAKE_CXX_COMPILER @CXX@) set(CMAKE_AR @AR@ CACHE FILEPATH "Archiver") set(CMAKE_LINKER @LD@ CACHE FILEPATH "Linker") -# where is the target environment -set(CMAKE_FIND_ROOT_PATH @prefix@/@deps_dir@ @use_toolchain@ @use_toolchain@/usr @use_sdk_path@ @use_sdk_path@/usr @use_toolchain@/sysroot/usr) -set(CMAKE_LIBRARY_PATH @prefix@/@deps_dir@/lib:@use_toolchain@/usr/lib/@use_host@:@use_toolchain@/lib/@use_host@) +# where is the target environment +set(CMAKE_FIND_ROOT_PATH @prefix@/@deps_dir@) +set(CMAKE_LIBRARY_PATH @prefix@/@deps_dir@/lib) +if(NOT "@use_toolchain@" STREQUAL "") + list(APPEND CMAKE_FIND_ROOT_PATH @use_toolchain@ @use_toolchain@/usr @use_toolchain@/sysroot/usr) + set(CMAKE_LIBRARY_PATH "${CMAKE_LIBRARY_PATH}:@use_toolchain@/usr/lib/@use_host@:@use_toolchain@/lib/@use_host@") +endif() +if(NOT "@use_sdk_path@" STREQUAL "") + list(APPEND CMAKE_FIND_ROOT_PATH @use_sdk_path@ @use_sdk_path@/usr) +endif() # add RBPI's firmware directories if("${CORE_SYSTEM_NAME}" STREQUAL "rbpi") |