diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2022-04-13 15:07:46 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-04-19 17:37:11 +0000 |
commit | f6f5e035921b242d36987b4c0e149df0075fb09d (patch) | |
tree | a6e6e926a9d6cef14c8b1d8d9338fa64d95b8687 | |
parent | 9e5b09b4aa1fe25a8da34bfd11ce9338a1311289 (diff) |
CMake: An -extprefix -developer-build should install by default
Previously if
-extprefix /tmp/sysroot (CMAKE_STAGING_PREFIX)
-developer-build (FEATURE_developer_build)
were specified, but
-prefix (CMAKE_INSTALL_PREFIX)
was not,
the build system would set the CMAKE_INSTALL_PREFIX to the
qtbase build dir.
Then, if targeting desktop, this would be considered a non-prefix
build (ninja install would refuse to work), whereas in a cross-build
it would be considered an installable build.
In both cases though, the rpath of installed binaries would point to
the qtbase build dir (because CMAKE_INSTALL_PREFIX would be set to the
qtbase build dir).
This is quite confusing behavior, in more than one way.
Change the build system to consider that an explicit -extprefix should
cause Qt to always be installed, even if -developer-build is
specified.
This means the installed rpaths and on-device install prefix
(CMAKE_INSTALL_PREFIX) will now use the default computed install
prefix, e.g. /usr/local/Qt
It also means that to get a non-installable developer + custom staging
and install (on-device) prefix build, users will have to be explicit
and set all the options
-extprefix ~/qt/qtbase_build_dir
-prefix /usr
-developer-build
Change-Id: Ib560452a4b4778860e0fd7666c76f8a6745773ee
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 5059f7adc2abbfe6085a7b9dd04cd8463e1a412a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtSetup.cmake | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmake/QtSetup.cmake b/cmake/QtSetup.cmake index 85bd27a2da..ebcc4c408a 100644 --- a/cmake/QtSetup.cmake +++ b/cmake/QtSetup.cmake @@ -110,7 +110,8 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_LINK_DEPENDS_NO_SHARED ON) # Detect non-prefix builds: either when the qtbase install prefix is set to the binary dir -# or when a developer build is explicitly enabled and no install prefix is specified. +# or when a developer build is explicitly enabled and no install prefix (or staging prefix) +# is specified. # This detection only happens when building qtbase, and later is propagated via the generated # QtBuildInternalsExtra.cmake file. if (PROJECT_NAME STREQUAL "QtBase" AND NOT QT_BUILD_STANDALONE_TESTS) @@ -118,8 +119,12 @@ if (PROJECT_NAME STREQUAL "QtBase" AND NOT QT_BUILD_STANDALONE_TESTS) # Handle both FEATURE_ and QT_FEATURE_ cases when they are specified on the command line # explicitly. It's possible for one to be set, but not the other, because # qtbase/configure.cmake is not processed by this point. - if(FEATURE_developer_build OR QT_FEATURE_developer_build - OR FEATURE_no_prefix OR QT_FEATURE_no_prefix) + if((FEATURE_developer_build + OR QT_FEATURE_developer_build + OR FEATURE_no_prefix + OR QT_FEATURE_no_prefix + ) + AND NOT CMAKE_STAGING_PREFIX) # Handle non-prefix builds by setting the CMake install prefix to point to qtbase's # build dir. While building another repo (like qtsvg) the CMAKE_PREFIX_PATH should be # set on the command line to point to the qtbase build dir. |