Merge pull request #3842 from sethjackson/cross-compile

Fix CMakeLists.txt search paths for cross compile
This commit is contained in:
Justin M. Keyes 2015-12-16 10:18:15 -05:00
commit f9647d99b4

View File

@ -6,8 +6,13 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Prefer our bundled versions of dependencies.
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding dependencies")
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
list(INSERT CMAKE_FIND_ROOT_PATH 0 ${DEPS_PREFIX})
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}/../host/bin)
else()
list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX})
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
endif()
# used for check_c_compiler_flag
include(CheckCCompilerFlag)