summaryrefslogtreecommitdiffstats
path: root/cmake/QtWrapperScriptHelpers.cmake
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amirmasoudabdol@icloud.com>2022-12-09 10:47:17 +0100
committerAmir Masoud Abdol <amirmasoudabdol@icloud.com>2022-12-10 11:43:08 +0100
commit8aae821b5aa2bd0ac919683dcb3cb62913ca9063 (patch)
tree8087a73fc9596ab28232c35f17ac6883df81ee6b /cmake/QtWrapperScriptHelpers.cmake
parentf3c998510d3a6c8fc468e449d66b0280119d0a8f (diff)
Fix for misplacement of the qt-cmake-standalone-test in -developer-build
Amend d77ce33082516234fd7bbb5335401a1f3af8ca27 Change-Id: Idab13c45b15b07e10bee47fff20481581d22dfac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake/QtWrapperScriptHelpers.cmake')
-rw-r--r--cmake/QtWrapperScriptHelpers.cmake52
1 files changed, 37 insertions, 15 deletions
diff --git a/cmake/QtWrapperScriptHelpers.cmake b/cmake/QtWrapperScriptHelpers.cmake
index c37291e20d..2be8a0ab6f 100644
--- a/cmake/QtWrapperScriptHelpers.cmake
+++ b/cmake/QtWrapperScriptHelpers.cmake
@@ -95,9 +95,15 @@ function(qt_internal_create_wrapper_scripts)
# find_package(Qt...) to get all dependencies like examples do.
# Instead a template CMakeLists.txt project is used which sets up all the necessary private bits
# and then calls add_subdirectory on the provided project path.
- set(__qt_cmake_standalone_test_bin_name "qt-cmake-standalone-test")
- set(__qt_cmake_standalone_test_bin_path
- "${INSTALL_BINDIR}/${__qt_cmake_standalone_test_bin_name}")
+ set(__qt_cmake_standalone_test_name "qt-cmake-standalone-test")
+ if(generate_unix)
+ set(__qt_cmake_standalone_test_libexec_path
+ "${INSTALL_LIBEXECDIR}/${__qt_cmake_standalone_test_name}")
+ endif()
+ if(generate_non_unix)
+ set(__qt_cmake_standalone_test_bin_path
+ "${INSTALL_BINDIR}/${__qt_cmake_standalone_test_name}")
+ endif()
# Configuring a standalone test on iOS should use the Xcode generator, but qt-cmake-private uses
# the generator that was used to build Qt itself (e.g. Ninja).
@@ -106,16 +112,19 @@ function(qt_internal_create_wrapper_scripts)
set(__qt_cmake_private_path
"${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake")
else()
- set(__qt_cmake_private_path
- "${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private")
+ if(generate_unix)
+ set(__qt_cmake_private_path
+ "${QT_STAGING_PREFIX}/${INSTALL_LIBEXECDIR}/qt-cmake-private")
+ endif()
+ if(generate_non_unix)
+ set(__qt_cmake_private_path
+ "${QT_STAGING_PREFIX}/${INSTALL_BINDIR}/qt-cmake-private.bat")
+ endif()
endif()
set(__qt_cmake_standalone_test_path
"${__build_internals_install_dir}/${__build_internals_standalone_test_template_dir}")
- get_filename_component(rel_base_path
- "${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_bin_path}"
- DIRECTORY)
if(QT_WILL_INSTALL)
# Need to prepend the staging prefix when doing prefix builds, because the build internals
# install dir is relative in that case..
@@ -124,12 +133,16 @@ function(qt_internal_create_wrapper_scripts)
"${__qt_cmake_standalone_test_path}")
endif()
- file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
- "${__qt_cmake_private_path}")
- file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
- "${__qt_cmake_standalone_test_path}")
-
if(generate_unix)
+ get_filename_component(rel_base_path
+ "${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_libexec_path}"
+ DIRECTORY)
+
+ file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
+ "${__qt_cmake_private_path}")
+ file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
+ "${__qt_cmake_standalone_test_path}")
+
set(__qt_cmake_standalone_test_os_prelude "#!/bin/sh")
set(__qt_cmake_standalone_test_script_relpath "SCRIPT_DIR=`dirname $0`")
string(PREPEND __qt_cmake_private_relpath "exec $SCRIPT_DIR/")
@@ -137,12 +150,21 @@ function(qt_internal_create_wrapper_scripts)
set(__qt_cmake_standalone_passed_args "\"$@\" -DPWD=\"$PWD\"")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/bin/qt-cmake-standalone-test.in"
- "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_bin_path}"
+ "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_libexec_path}"
NEWLINE_STYLE LF)
- qt_install(PROGRAMS "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_bin_path}"
+ qt_install(PROGRAMS "${QT_BUILD_DIR}/${__qt_cmake_standalone_test_libexec_path}"
DESTINATION "${INSTALL_LIBEXECDIR}")
endif()
if(generate_non_unix)
+ get_filename_component(rel_base_path
+ "${QT_STAGING_PREFIX}/${__qt_cmake_standalone_test_bin_path}"
+ DIRECTORY)
+
+ file(RELATIVE_PATH __qt_cmake_private_relpath "${rel_base_path}"
+ "${__qt_cmake_private_path}")
+ file(RELATIVE_PATH __qt_cmake_standalone_test_relpath "${rel_base_path}"
+ "${__qt_cmake_standalone_test_path}")
+
set(__qt_cmake_standalone_test_os_prelude "@echo off")
set(__qt_cmake_standalone_test_script_relpath "set SCRIPT_DIR=%~dp0")
string(APPEND __qt_cmake_standalone_test_bin_path ".bat")