diff options
Diffstat (limited to 'share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl')
-rw-r--r-- | share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl | 40 |
1 files changed, 17 insertions, 23 deletions
diff --git a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl index 086b6bc2e9d..ef31652b0eb 100644 --- a/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl +++ b/share/qtcreator/qmldesigner/studio_templates/projects/common/CMakeLists.main.txt.tpl @@ -1,44 +1,36 @@ cmake_minimum_required(VERSION 3.21.1) -set(BUILD_QDS_COMPONENTS ON CACHE BOOL "Build design studio components") option(LINK_INSIGHT "Link Qt Insight Tracker library" ON) +option(BUILD_QDS_COMPONENTS "Build design studio components" ON) project(%{ProjectName}App LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) -find_package(QT NAMES Qt6 COMPONENTS Gui Qml Quick) -find_package(Qt6 REQUIRED COMPONENTS Core Qml Quick) +find_package(Qt6 6.2 REQUIRED COMPONENTS Core Gui Qml Quick) -# To build this application you need Qt 6.2.0 or higher -if (Qt6_VERSION VERSION_LESS 6.2.0) -message(FATAL_ERROR "You need Qt 6.2.0 or newer to build the application.") +if (Qt6_VERSION VERSION_GREATER_EQUAL 6.3) + qt_standard_project_setup() endif() -qt_add_executable(${CMAKE_PROJECT_NAME} src/main.cpp) +qt_add_executable(%{ProjectName}App src/main.cpp) -# qt_standard_project_setup() requires Qt 6.3 or higher. See https://doc.qt.io/qt-6/qt-standard-project-setup.html for details. -if (${QT_VERSION_MINOR} GREATER_EQUAL 3) -qt6_standard_project_setup() -endif() - -qt_add_resources(${CMAKE_PROJECT_NAME} "configuration" +qt_add_resources(%{ProjectName}App "configuration" PREFIX "/" FILES qtquickcontrols2.conf ) -target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE - Qt${QT_VERSION_MAJOR}::Core - Qt${QT_VERSION_MAJOR}::Gui - Qt${QT_VERSION_MAJOR}::Quick - Qt${QT_VERSION_MAJOR}::Qml +target_link_libraries(%{ProjectName}App PRIVATE + Qt6::Core + Qt6::Gui + Qt6::Qml + Qt6::Quick ) -if (${BUILD_QDS_COMPONENTS}) +if (BUILD_QDS_COMPONENTS) include(${CMAKE_CURRENT_SOURCE_DIR}/qmlcomponents) -endif () +endif() include(${CMAKE_CURRENT_SOURCE_DIR}/qmlmodules) @@ -46,6 +38,8 @@ if (LINK_INSIGHT) include(${CMAKE_CURRENT_SOURCE_DIR}/insight) endif () -install(TARGETS ${CMAKE_PROJECT_NAME} +install(TARGETS %{ProjectName}App BUNDLE DESTINATION . - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +) |