From 7be143f43849dc9a6917d4165a7ec459f53983b8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 8 Nov 2021 17:07:35 +0100 Subject: CMake: Fix default install prefix of top-level non-developer builds A top-level non-developer build is supposed to default to a prefix like "/usr/local/Qt-6.3.0". That wasn't the case. In QtSetup.cmake we check CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT, set CMAKE_INSTALL_PREFIX and did the same thing later in QtBuildInternalsExtra.cmake, with a different value. Make sure we run the latter code only in per-repo builds. Pick-to: 6.2 Fixes: QTBUG-98087 Change-Id: I4a1291dfd126aa11c21d69809f2cf7b075c98d2e Reviewed-by: Alexandru Croitor --- cmake/QtBuildInternalsExtra.cmake.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cmake') diff --git a/cmake/QtBuildInternalsExtra.cmake.in b/cmake/QtBuildInternalsExtra.cmake.in index 6c76c17093..cbd70b1f7b 100644 --- a/cmake/QtBuildInternalsExtra.cmake.in +++ b/cmake/QtBuildInternalsExtra.cmake.in @@ -20,8 +20,10 @@ get_filename_component(QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX # If an explicit installation prefix is specified, honor it. # This is an attempt to support Conan, aka handle installation of modules into a # different installation prefix than the original one. Also allow to opt out via a special variable. +# In a top-level build, QtSetup.cmake takes care of setting CMAKE_INSTALL_PREFIX. if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND - NOT QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX) + NOT QT_BUILD_INTERNALS_NO_FORCE_SET_INSTALL_PREFIX + AND NOT QT_SUPERBUILD) set(qtbi_orig_prefix "@CMAKE_INSTALL_PREFIX@") set(qtbi_new_prefix "${QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX}") if(CMAKE_HOST_WIN32) -- cgit v1.2.3