From db2cc2ba2745dfdc268698582610eb11e3bbb91b Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 13 Jun 2022 09:42:34 +0200 Subject: [PATCH] Add install command to wizard generated CMake files Add a default install(TARGETS ...) command. It doesn't hurt on desktop and mobile targets, and it is required for deployment on remote Linux devices. Change-Id: Ib39c6130b63a9a699ff5cd81756c2913b1246142 Reviewed-by: Cristian Adam Reviewed-by: --- .../templates/wizards/projects/consoleapp/CMakeLists.txt | 2 ++ .../qtcreator/templates/wizards/projects/plainc/CMakeLists.txt | 2 ++ .../templates/wizards/projects/plaincpp/CMakeLists.txt | 2 ++ .../wizards/projects/qtquickapplication/CMakeLists.6.x.txt | 2 ++ .../wizards/projects/qtquickapplication/CMakeLists.txt | 2 ++ .../wizards/projects/qtwidgetsapplication/CMakeLists.txt | 2 ++ 6 files changed, 12 insertions(+) diff --git a/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt index b27ac6d8cab..1af66d937b6 100644 --- a/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/consoleapp/CMakeLists.txt @@ -36,3 +36,5 @@ else() qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${TS_FILES}) endif() @endif + +install(TARGETS %{ProjectName}) diff --git a/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt index 5af2f09fb67..d33adb59eb8 100644 --- a/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plainc/CMakeLists.txt @@ -3,3 +3,5 @@ cmake_minimum_required(VERSION 3.5) project(%{ProjectName} LANGUAGES C) add_executable(%{ProjectName} %{CFileName}) + +install(TARGETS %{ProjectName}) diff --git a/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt index 214e8979d4a..c8a95f5a4ce 100644 --- a/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/plaincpp/CMakeLists.txt @@ -6,3 +6,5 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_executable(%{ProjectName} %{CppFileName}) + +install(TARGETS %{ProjectName}) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt index d47f49ab3bd..a59656b3733 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.6.x.txt @@ -27,3 +27,5 @@ set_target_properties(%{TargetName} PROPERTIES target_link_libraries(%{TargetName} PRIVATE Qt6::Quick) + +install(TARGETS %{ProjectName} BUNDLE DESTINATION .) diff --git a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt index cac41d7c1e7..79ad6ad2991 100644 --- a/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtquickapplication/CMakeLists.txt @@ -71,6 +71,8 @@ set_target_properties(%{ProjectName} PROPERTIES WIN32_EXECUTABLE TRUE ) +install(TARGETS %{ProjectName} BUNDLE DESTINATION .) + if(QT_VERSION_MAJOR EQUAL 6) qt_import_qml_plugins(%{ProjectName}) qt_finalize_executable(%{ProjectName}) diff --git a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt index 32ceeffc55b..9dc83c698c0 100644 --- a/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt +++ b/share/qtcreator/templates/wizards/projects/qtwidgetsapplication/CMakeLists.txt @@ -74,6 +74,8 @@ set_target_properties(%{ProjectName} PROPERTIES WIN32_EXECUTABLE TRUE ) +install(TARGETS %{ProjectName} BUNDLE DESTINATION .) + if(QT_VERSION_MAJOR EQUAL 6) qt_finalize_executable(%{ProjectName}) endif()