From f3483e6b962efd03ccf7633cb68f0c3b91b5c07c Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 13 Apr 2022 14:57:34 +0200 Subject: CMake: Allow no install + custom on-device prefix for desktop builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow such a combination - staging prefix (CMAKE_STAGING_PREFIX / -extprefix) set to the qtbase build dir - install prefix (CMAKE_INSTALL_PREFIX / -prefix / on-device prefix) set to some custom location even for non-cross builds. An example would be configure -prefix /usr \ -extprefix ~/qt/qtbase_build_dir CMake will put the Qt libraries in the qtbase build dir, ninja install will not be required, but ultimately in order to run applications, the Qt libraries are expected to be in /usr. Support for this scenario was originally added for cross-builds in 062318feb2d3b7598409c7e81e4459c2f4607764 , but not desktop builds. Such a build is useful when you want to have install rpaths different from where Qt is initially installed to (the staging prefix). This case doesn't really happen often when targeting desktop platforms, it's mostly used for cross-compilation (e.g yocto). Being able to have the same setup with a desktop build is nevertheless useful for faster iteration on build system issues in such a scenario. Amends 062318feb2d3b7598409c7e81e4459c2f4607764 Pick-to: 6.2 6.3 Change-Id: I42be3628a30025f14eebaf0a79401b54e95cde26 Reviewed-by: Qt CI Bot Reviewed-by: Jörg Bornemann --- cmake/QtBuild.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmake/QtBuild.cmake') diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index d293c0d083..d5eb7c22cd 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -140,7 +140,7 @@ qt_configure_process_path(INSTALL_DESCRIPTIONSDIR "${INSTALL_DATADIR}/modules" "Module description files directory") -if(CMAKE_CROSSCOMPILING AND NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "") +if(NOT "${CMAKE_STAGING_PREFIX}" STREQUAL "") set(QT_STAGING_PREFIX "${CMAKE_STAGING_PREFIX}") else() set(QT_STAGING_PREFIX "${CMAKE_INSTALL_PREFIX}") -- cgit v1.2.3