summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-06-26 12:39:05 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-06-26 11:38:01 +0000
commit1a8799bfdddbe45392fb6524ae21c1ab39df74e1 (patch)
tree122903088a4a0033e83b70eb6b5bd3ead079606c
parent8c60782124aa7fe54ade1f67bd85b11068735314 (diff)
Fix osx deployment target and sysroot propagation in the qt toolchain
We need to save them in the toolchain file, otherwise we can't compile anything :) Change-Id: Ic5c53524fa4aa05d0b3229c2905dff92ca437ec1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot
-rw-r--r--cmake/QtBaseGlobalTargets.cmake10
-rw-r--r--cmake/qt.toolchain.cmake.in2
2 files changed, 12 insertions, 0 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index d71065c6d9..3409d044ff 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -78,7 +78,17 @@ if(VCPKG_TARGET_TRIPLET)
list(APPEND init_vcpkg "set(VCPKG_TARGET_TRIPLET \"${VCPKG_TARGET_TRIPLET}\" CACHE STRING \"\")")
endif()
+if(APPLE)
+ if(CMAKE_OSX_SYSROOT)
+ list(APPEND init_platform "set(CMAKE_OSX_SYSROOT \"${CMAKE_OSX_SYSROOT}\" CACHE PATH \"\")")
+ endif()
+ if(CMAKE_OSX_DEPLOYMENT_TARGET)
+ list(APPEND init_platform "set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\" CACHE STRING \"\")")
+ endif()
+endif()
+
string(REPLACE ";" "\n" init_vcpkg "${init_vcpkg}")
+string(REPLACE ";" "\n" init_platform "${init_platform}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/qt.toolchain.cmake.in" "${__GlobalConfig_build_dir}/qt.toolchain.cmake" @ONLY)
qt_install(FILES "${__GlobalConfig_build_dir}/qt.toolchain.cmake" DESTINATION "${__GlobalConfig_install_dir}" COMPONENT Devel)
diff --git a/cmake/qt.toolchain.cmake.in b/cmake/qt.toolchain.cmake.in
index d816e1dcc9..22bfe6baec 100644
--- a/cmake/qt.toolchain.cmake.in
+++ b/cmake/qt.toolchain.cmake.in
@@ -1,6 +1,8 @@
list(APPEND CMAKE_PREFIX_PATH "@CMAKE_INSTALL_PREFIX@")
list(APPEND CMAKE_FIND_ROOT_PATH "@CMAKE_INSTALL_PREFIX@")
+@init_platform@
+
@init_qt_host_path@
@init_original_toolchain_file@