diff options
Diffstat (limited to 'tests/auto/cmake/test_widgets_app_deployment')
-rw-r--r-- | tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt | 18 | ||||
-rw-r--r-- | tests/auto/cmake/test_widgets_app_deployment/main.cpp | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt index aa30954f45..9457278e12 100644 --- a/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt +++ b/tests/auto/cmake/test_widgets_app_deployment/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + cmake_minimum_required(VERSION 3.16) project(deployment_api) enable_testing() @@ -9,7 +12,12 @@ qt6_standard_project_setup() function(create_test_executable target) cmake_parse_arguments(arg "" "" "" ${ARGN}) - qt_add_executable(${target} main.cpp) + if(CMAKE_VERSION VERSION_LESS "3.19") + qt_add_executable(${target} MANUAL_FINALIZATION main.cpp) + else() + qt_add_executable(${target} main.cpp) + endif() + set_target_properties(${target} PROPERTIES # We explicitly don't set WIN32_EXECUTABLE to ensure we see errors from stderr when # something fails and not having to use DebugView. @@ -25,16 +33,22 @@ function(create_test_executable target) qt_generate_deploy_app_script( TARGET ${target} - FILENAME_VARIABLE deploy_script + OUTPUT_SCRIPT deploy_script # Don't fail at configure time on unsupported platforms NO_UNSUPPORTED_PLATFORM_ERROR ) install(SCRIPT ${deploy_script}) + if(CMAKE_VERSION VERSION_LESS "3.19") + qt_finalize_target(${target}) + endif() + if(APPLE AND NOT IOS) set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${target}.app/Contents/MacOS/${target}") elseif(WIN32) set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${target}.exe") + elseif(UNIX AND NOT APPLE AND NOT ANDROID AND NOT CMAKE_CROSSCOMPILING) + set(installed_app_location "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/${target}") endif() # There's no nice way to get the location of an installed binary, so we need to construct diff --git a/tests/auto/cmake/test_widgets_app_deployment/main.cpp b/tests/auto/cmake/test_widgets_app_deployment/main.cpp index 1823a50169..939cd72380 100644 --- a/tests/auto/cmake/test_widgets_app_deployment/main.cpp +++ b/tests/auto/cmake/test_widgets_app_deployment/main.cpp @@ -1,5 +1,5 @@ // Copyright (C) 2022 The Qt Company Ltd. -// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtTest> #include <QMainWindow> |