Skip to content

Commit

Permalink
Fix toolchain path when doing non-prefix builds
Browse files Browse the repository at this point in the history
Previously the cmake install prefix was added twice during a non-prefix
build, which evaluated to an incorrect path.

Set another absolute dir variable, and use that instead.

Change-Id: I73099510dadc8f401d5a763f21840c9671686c10
Reviewed-by: Simon Hausmann <[email protected]>
Reviewed-by: Qt CMake Build Bot
  • Loading branch information
alcroito committed Jul 3, 2019
1 parent d9da52d commit 38640f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bin/qt-cmake.bat.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@CMAKE_COMMAND@ -DCMAKE_TOOLCHAIN_FILE=@CMAKE_INSTALL_PREFIX@/@__GlobalConfig_install_dir@/qt.toolchain.cmake %*
@CMAKE_COMMAND@ -DCMAKE_TOOLCHAIN_FILE=@__GlobalConfig_install_dir_absolute@/qt.toolchain.cmake %*
2 changes: 1 addition & 1 deletion bin/qt-cmake.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/sh

exec @CMAKE_COMMAND@ -DCMAKE_TOOLCHAIN_FILE=@CMAKE_INSTALL_PREFIX@/@__GlobalConfig_install_dir@/qt.toolchain.cmake $*
exec @CMAKE_COMMAND@ -DCMAKE_TOOLCHAIN_FILE=@__GlobalConfig_install_dir_absolute@/qt.toolchain.cmake $*
7 changes: 7 additions & 0 deletions cmake/QtBaseGlobalTargets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ endif()
set(__GlobalConfig_path_suffix "${INSTALL_CMAKE_NAMESPACE}")
qt_path_join(__GlobalConfig_build_dir ${QT_CONFIG_BUILD_DIR} ${__GlobalConfig_path_suffix})
qt_path_join(__GlobalConfig_install_dir ${QT_CONFIG_INSTALL_DIR} ${__GlobalConfig_path_suffix})
set(__GlobalConfig_install_dir_absolute "${__GlobalConfig_install_dir}")
if(QT_WILL_INSTALL)
# Need to prepend the install prefix when doing prefix builds, because the config install dir
# is relative then.
qt_path_join(__GlobalConfig_install_dir_absolute
${CMAKE_INSTALL_PREFIX} ${__GlobalConfig_install_dir_absolute})
endif()

# Generate and install Qt6 config file.
configure_package_config_file(
Expand Down

0 comments on commit 38640f7

Please sign in to comment.