diff options
author | Kai Köhne <kai.koehne@qt.io> | 2022-01-20 17:19:52 +0100 |
---|---|---|
committer | Kai Köhne <kai.koehne@qt.io> | 2022-01-20 18:05:52 +0100 |
commit | 3dae1461ac3c6fed4303a5bf475c72d573d8c7c6 (patch) | |
tree | a2682e471984dbc79ca7f90854085e23f7164f63 /examples/demos | |
parent | a06c9e74fd545bb8b0b74ef59b1eb51d787d7727 (diff) | |
download | qtdoc-3dae1461ac3c6fed4303a5bf475c72d573d8c7c6.tar.gz |
Examples: Improve CMakeLists.txt files
Pick-to: 6.2 6.3
Change-Id: I7582f6c1b9daacaf694355269663b1d6616e0c05
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'examples/demos')
-rw-r--r-- | examples/demos/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/demos/calqlatr/CMakeLists.txt | 4 | ||||
-rw-r--r-- | examples/demos/clocks/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/coffee/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/hangman/CMakeLists.txt | 10 | ||||
-rw-r--r-- | examples/demos/maroon/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/photosurface/CMakeLists.txt | 11 | ||||
-rw-r--r-- | examples/demos/photoviewer/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/rssnews/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/samegame/CMakeLists.txt | 13 | ||||
-rw-r--r-- | examples/demos/stocqt/CMakeLists.txt | 12 | ||||
-rw-r--r-- | examples/demos/tweetsearch/CMakeLists.txt | 12 |
12 files changed, 36 insertions, 89 deletions
diff --git a/examples/demos/CMakeLists.txt b/examples/demos/CMakeLists.txt index f128061d..dc859bd0 100644 --- a/examples/demos/CMakeLists.txt +++ b/examples/demos/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from demos.pro. - if(TARGET Qt::Quick) qt_internal_add_example(samegame) qt_internal_add_example(calqlatr) @@ -19,4 +17,3 @@ if(TARGET Qt::Quick AND TARGET Qt::Network AND TARGET Qt::QmlXmlListModel) qt_internal_add_example(rssnews) qt_internal_add_example(photoviewer) endif() - diff --git a/examples/demos/calqlatr/CMakeLists.txt b/examples/demos/calqlatr/CMakeLists.txt index 903fc94d..8c00dd79 100644 --- a/examples/demos/calqlatr/CMakeLists.txt +++ b/examples/demos/calqlatr/CMakeLists.txt @@ -6,12 +6,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/calqlatr") -find_package(Qt6 COMPONENTS Core Gui Qml Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(calqlatrexample WIN32 MACOSX_BUNDLE main.cpp diff --git a/examples/demos/clocks/CMakeLists.txt b/examples/demos/clocks/CMakeLists.txt index 8fc75d1a..6138ef28 100644 --- a/examples/demos/clocks/CMakeLists.txt +++ b/examples/demos/clocks/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from clocks.pro. - cmake_minimum_required(VERSION 3.16) project(clocks LANGUAGES CXX) @@ -9,23 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/clocks") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(clocks main.cpp ) + set_target_properties(clocks PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(clocks PUBLIC Qt::Core Qt::Gui @@ -33,7 +30,6 @@ target_link_libraries(clocks PUBLIC Qt::Quick ) - # Resources: set(clocks_resource_files "clocks.qml" diff --git a/examples/demos/coffee/CMakeLists.txt b/examples/demos/coffee/CMakeLists.txt index e6f2697a..2b70d67b 100644 --- a/examples/demos/coffee/CMakeLists.txt +++ b/examples/demos/coffee/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from coffee.pro. - cmake_minimum_required(VERSION 3.16) project(coffee LANGUAGES CXX) @@ -9,23 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(coffee main.cpp ) + set_target_properties(coffee PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(coffee PUBLIC Qt::Core Qt::Gui @@ -33,7 +30,6 @@ target_link_libraries(coffee PUBLIC Qt::Quick ) - # Resources: set(qml_resource_files "ApplicationFlow.qml" diff --git a/examples/demos/hangman/CMakeLists.txt b/examples/demos/hangman/CMakeLists.txt index 629b34f7..bfeab944 100644 --- a/examples/demos/hangman/CMakeLists.txt +++ b/examples/demos/hangman/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from hangman.pro. - ##################################################################### ## hangman Binary: ##################################################################### @@ -12,17 +10,13 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/hangman") set(OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/demos/hangman") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS QuickControls2) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick QuickControls2) qt_add_executable(hangman MANUAL_FINALIZATION diff --git a/examples/demos/maroon/CMakeLists.txt b/examples/demos/maroon/CMakeLists.txt index 571d437e..62724fd8 100644 --- a/examples/demos/maroon/CMakeLists.txt +++ b/examples/demos/maroon/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from maroon.pro. - cmake_minimum_required(VERSION 3.16) project(maroon LANGUAGES CXX) @@ -9,23 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/maroon") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(maroon main.cpp ) + set_target_properties(maroon PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(maroon PUBLIC Qt::Core Qt::Gui @@ -33,7 +30,6 @@ target_link_libraries(maroon PUBLIC Qt::Quick ) - # Resources: set(maroon_resource_files "content/BuildButton.qml" diff --git a/examples/demos/photosurface/CMakeLists.txt b/examples/demos/photosurface/CMakeLists.txt index b2f965b7..67d021b4 100644 --- a/examples/demos/photosurface/CMakeLists.txt +++ b/examples/demos/photosurface/CMakeLists.txt @@ -1,6 +1,3 @@ -# Generated from photosurface.pro. -# special case skip regeneration - cmake_minimum_required(VERSION 3.16) project(photosurface LANGUAGES CXX) @@ -10,15 +7,12 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/photosurface") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) if (WIN32) #! [appicon_windows] @@ -50,7 +44,6 @@ target_link_libraries(photosurface PUBLIC Qt::Quick ) - # Resources: set(photosurface_resource_files "photosurface.qml" diff --git a/examples/demos/photoviewer/CMakeLists.txt b/examples/demos/photoviewer/CMakeLists.txt index 8c10d30c..0bc5f670 100644 --- a/examples/demos/photoviewer/CMakeLists.txt +++ b/examples/demos/photoviewer/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from photoviewer.pro. - cmake_minimum_required(VERSION 3.16) project(photoviewer LANGUAGES CXX) @@ -9,20 +7,17 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/photoviewer") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS QmlXmlListModel) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml QmlXmlListModel Quick) qt_add_executable(photoviewer main.cpp ) + set_target_properties(photoviewer PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -36,7 +31,6 @@ target_link_libraries(photoviewer PUBLIC Qt::QmlXmlListModel ) - # Resources: set(qmake_immediate_resource_files "PhotoViewerCore/AlbumDelegate.qml" diff --git a/examples/demos/rssnews/CMakeLists.txt b/examples/demos/rssnews/CMakeLists.txt index 1ccd8827..95d9ab31 100644 --- a/examples/demos/rssnews/CMakeLists.txt +++ b/examples/demos/rssnews/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from rssnews.pro. - cmake_minimum_required(VERSION 3.16) project(rssnews LANGUAGES CXX) @@ -9,20 +7,17 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/rssnews") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS QmlXmlListModel) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml QmlXmlListModel Quick) qt_add_executable(rssnews main.cpp ) + set_target_properties(rssnews PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE @@ -36,7 +31,6 @@ target_link_libraries(rssnews PUBLIC Qt::QmlXmlListModel ) - # Resources: set(rssnews_resource_files "content/BusyIndicator.qml" diff --git a/examples/demos/samegame/CMakeLists.txt b/examples/demos/samegame/CMakeLists.txt index 94e764f5..5892c9ce 100644 --- a/examples/demos/samegame/CMakeLists.txt +++ b/examples/demos/samegame/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from samegame.pro. - cmake_minimum_required(VERSION 3.16) project(samegame LANGUAGES CXX) @@ -9,24 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/samegame") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Sql) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick Sql) qt_add_executable(samegame main.cpp ) + set_target_properties(samegame PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(samegame PUBLIC Qt::Core Qt::Gui @@ -35,7 +31,6 @@ target_link_libraries(samegame PUBLIC Qt::Sql ) - # Resources: set(samegame_resource_files "content/Block.qml" diff --git a/examples/demos/stocqt/CMakeLists.txt b/examples/demos/stocqt/CMakeLists.txt index e23a227f..bf9bdd67 100644 --- a/examples/demos/stocqt/CMakeLists.txt +++ b/examples/demos/stocqt/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from stocqt.pro. - cmake_minimum_required(VERSION 3.16) project(stocqt LANGUAGES CXX) @@ -9,23 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/stocqt") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(stocqt main.cpp ) + set_target_properties(stocqt PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(stocqt PUBLIC Qt::Core Qt::Gui @@ -33,7 +30,6 @@ target_link_libraries(stocqt PUBLIC Qt::Quick ) - # Resources: set(stocqt_resource_files "content/+windows/Settings.qml" diff --git a/examples/demos/tweetsearch/CMakeLists.txt b/examples/demos/tweetsearch/CMakeLists.txt index f759a026..1750d048 100644 --- a/examples/demos/tweetsearch/CMakeLists.txt +++ b/examples/demos/tweetsearch/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from tweetsearch.pro. - cmake_minimum_required(VERSION 3.16) project(tweetsearch LANGUAGES CXX) @@ -9,23 +7,22 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/demos/tweetsearch") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(tweetsearch main.cpp ) + set_target_properties(tweetsearch PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(tweetsearch PUBLIC Qt::Core Qt::Gui @@ -33,7 +30,6 @@ target_link_libraries(tweetsearch PUBLIC Qt::Quick ) - # Resources: set(qmake_content_resource_files "content/FlipBar.qml" |