diff options
-rw-r--r-- | cmake/QtCreatorConfig.cmake.in | 2 | ||||
-rw-r--r-- | src/CMakeLists.txt | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/cmake/QtCreatorConfig.cmake.in b/cmake/QtCreatorConfig.cmake.in index c99bf03f4ac..a354028933d 100644 --- a/cmake/QtCreatorConfig.cmake.in +++ b/cmake/QtCreatorConfig.cmake.in @@ -14,6 +14,8 @@ if(UNIX AND NOT APPLE) set(CMAKE_INSTALL_DATAROOTDIR "@CMAKE_INSTALL_DATAROOTDIR@") endif() +set(QTCREATOR_RELOCATABLE_INSTALL_PREFIX "@PACKAGE_QTCREATOR_RELOCATABLE_INSTALL_PREFIX@") + include(CMakeFindDependencyMacro) find_dependency(Qt6 "@IDE_QT_VERSION_MIN@" REQUIRED COMPONENTS diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3a7778de1f5..cc8d12d3fd8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,9 +41,12 @@ set(configure_package_config_file_input_path "${PROJECT_SOURCE_DIR}/cmake/QtCrea set(common_configure_package_config_file_options NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO + PATH_VARS + QTCREATOR_RELOCATABLE_INSTALL_PREFIX ) # Build-tree Config file, used in super build projects that call add_subdirectory(qtcreator). +set(QTCREATOR_RELOCATABLE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}") configure_package_config_file( "${configure_package_config_file_input_path}" "${CMAKE_BINARY_DIR}/cmake/QtCreatorConfig.cmake" @@ -53,6 +56,7 @@ configure_package_config_file( ) # Install-tree Config file, used in non-super build projects. +set(QTCREATOR_RELOCATABLE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}") configure_package_config_file( "${configure_package_config_file_input_path}" # This is generated into a different directory on purpose, so it doesn't collide with the |