diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-06-22 18:01:30 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-07-01 18:09:03 +0200 |
commit | 062318feb2d3b7598409c7e81e4459c2f4607764 (patch) | |
tree | 72fd987ee02f90a48bda03ddd5db93111339fdf7 /cmake/QtBuild.cmake | |
parent | 389c772fd4a04933d95904e88470506a44535f92 (diff) |
CMake: Fix non-prefix build detection when CMAKE_STAGING_PREFIX is set
It wasn't possible to create a cross, non-prefix build with
CMAKE_INSTALL_PREFIX set to something else but the qtbase build dir
and CMAKE_STAGING_PREFIX set to the qtbase build dir.
This would be equivalent to
configure -prefix /usr \
-extprefix ~/my/qtbase/build/dir
Fix this by comparing the qtbase build dir against
CMAKE_STAGING_PREFIX if it is set. We also have to adjust the
QT_BUILD_DIR variable in a similar way.
Change-Id: Iaba5cf0f6954ae4b15d8af1fc62634f5d7f68835
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtBuild.cmake')
-rw-r--r-- | cmake/QtBuild.cmake | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index c3a9d0135d..bde23072ea 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -145,8 +145,13 @@ function(qt_internal_set_up_global_paths) set(QT_BUILD_DIR "${QtBase_BINARY_DIR}") set(QT_INSTALL_DIR "") else() - set(QT_BUILD_DIR "${QtBase_BINARY_DIR}") - set(QT_INSTALL_DIR "${QtBase_BINARY_DIR}") + if("${CMAKE_STAGING_PREFIX}" STREQUAL "") + set(QT_BUILD_DIR "${QtBase_BINARY_DIR}") + set(QT_INSTALL_DIR "${QtBase_BINARY_DIR}") + else() + set(QT_BUILD_DIR "${CMAKE_STAGING_PREFIX}") + set(QT_INSTALL_DIR "${CMAKE_STAGING_PREFIX}") + endif() endif() else() if(QT_WILL_INSTALL) @@ -157,7 +162,11 @@ function(qt_internal_set_up_global_paths) else() # When doing a non-prefix build, both the build dir and install dir are the same, # pointing to the qtbase build dir. - set(QT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}") + if("${CMAKE_STAGING_PREFIX}" STREQUAL "") + set(QT_BUILD_DIR "${CMAKE_INSTALL_PREFIX}") + else() + set(QT_BUILD_DIR "${CMAKE_STAGING_PREFIX}") + endif() set(QT_INSTALL_DIR "${QT_BUILD_DIR}") endif() endif() |