summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2020-09-08 15:31:39 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2020-09-09 18:52:54 +0200
commit7b6d8261d87daeecf0f541496b7a35911ae7e86b (patch)
treeb10c1a5673dffb3dcea1c1b5696f8829ba1e5b03 /cmake
parenta6a3b82ffb3d7f1ea13293206401ed360a51e9cd (diff)
CMake: Fix building of non-qtbase repos on Android with Windows host
The generated toolchain file embedded windows style paths for the android sdk and chainloaded toolchain. This caused CMake does fail at configure time while trying to evaluate backslashes as escape chars. Also syncqt was searched for in libexec, which is not the right directory on Windows. Use the host info package to get the location of the 'libexec'. Task-number: QTBUG-85399 Task-number: QTBUG-85911 Task-number: QTBUG-86053 Change-Id: I1b15ce84496d52c3fda2f65138e1eac43bc95c9e Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake6
-rw-r--r--cmake/QtSyncQtHelpers.cmake2
2 files changed, 5 insertions, 3 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index 975defcb83..4e4f7a442a 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -110,7 +110,8 @@ endif()")
endif()
if(CMAKE_TOOLCHAIN_FILE)
- set(init_original_toolchain_file "set(__qt_chainload_toolchain_file \"${CMAKE_TOOLCHAIN_FILE}\")")
+ file(TO_CMAKE_PATH "${CMAKE_TOOLCHAIN_FILE}" __qt_chainload_toolchain_file)
+ set(init_original_toolchain_file "set(__qt_chainload_toolchain_file \"${__qt_chainload_toolchain_file}\")")
endif()
if(VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
@@ -196,7 +197,8 @@ elseif(ANDROID)
list(APPEND init_platform "set(ANDROID_STL \"${ANDROID_STL}\" CACHE STRING \"\")")
list(APPEND init_platform "set(ANDROID_ABI \"${ANDROID_ABI}\" CACHE STRING \"\")")
list(APPEND init_platform "if (NOT DEFINED ANDROID_SDK_ROOT)")
- list(APPEND init_platform " set(ANDROID_SDK_ROOT \"${ANDROID_SDK_ROOT}\" CACHE STRING \"\")")
+ file(TO_CMAKE_PATH "${ANDROID_SDK_ROOT}" __qt_android_sdk_root)
+ list(APPEND init_platform " set(ANDROID_SDK_ROOT \"${__qt_android_sdk_root}\" CACHE STRING \"\")")
list(APPEND init_platform "endif()")
endif()
diff --git a/cmake/QtSyncQtHelpers.cmake b/cmake/QtSyncQtHelpers.cmake
index a161c8ecbe..c8d89d64ee 100644
--- a/cmake/QtSyncQtHelpers.cmake
+++ b/cmake/QtSyncQtHelpers.cmake
@@ -29,7 +29,7 @@ function(qt_ensure_sync_qt)
DESTINATION "${syncqt_install_dir}")
elseif(QT_HOST_PATH)
get_filename_component(syncqt_absolute_path
- "${QT_HOST_PATH}/${INSTALL_LIBEXECDIR}/syncqt.pl"
+ "${QT_HOST_PATH}/${QT${PROJECT_VERSION_MAJOR}_HOST_INFO_LIBEXECDIR}/syncqt.pl"
ABSOLUTE)
set(QT_SYNCQT "${syncqt_absolute_path}" CACHE FILEPATH "syncqt script")
message(STATUS "Using host syncqt found at: ${QT_SYNCQT}")