iOS: Allow setting multiple CMAKE_FIND_ROOT_PATH values

Currently the value is hardcoded to contain only the sysroot for
the respective darwin platform. This means that it can not be changed
in a custom toolchain file.

Instead of overriding the value, simply append it. This is similar
to how it is done in the Google provided Android toolchain file.

The usecase is to allow specifying addiitonal roots to look for
3rd party packages which are definitely not present in the default
sysroot.
This commit is contained in:
Alexandru Croitor
2019-04-30 13:34:47 +02:00
parent 1011350694
commit 94c5fa5f7a

View File

@@ -5,7 +5,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "iOS" OR CMAKE_SYSTEM_NAME STREQUAL "tvOS" OR CMAK
set(CMAKE_MACOSX_BUNDLE ON)
endif()
set(CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}")
list(APPEND CMAKE_FIND_ROOT_PATH "${_CMAKE_OSX_SYSROOT_PATH}")
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
endif()