diff options
author | Kai Köhne <[email protected]> | 2022-01-20 17:42:48 +0100 |
---|---|---|
committer | Kai Köhne <[email protected]> | 2022-01-24 13:25:13 +0100 |
commit | 9d82f4bff8520c3f6db7790d9044c3dfc5cc84c0 (patch) | |
tree | 208f1e58e65083c7ddad2abdf1473679176fdaad /examples/qml | |
parent | a3924b9846f8f3412e6cfc3704f69488e64da98e (diff) |
Improve examples CMakeLists.txt
- Remove # generated from xyz.pro comment from pro2cmake
- Remove "# special case" markers for pro2cmake
- Remove automatic use of CMAKE_AUTORCC
- Only opt into CMAKE_AUTOUIC if .ui files are involved
- Remove explicit setting of CMAKE_INCLUDE_CURRENT_DIR
- Combine multiple find_package(Qt6 ... calls)
- use REQUIRED COMPONENTS
- sort components alphabetically
- Fix wrong indentations
- Use (only) one empty line after multi-line commands
Pick-to: 6.3
Change-Id: I0d6bfb06c4b25e9921d3d2bf31d977150f12b31b
Reviewed-by: Qt CI Bot <[email protected]>
Reviewed-by: Jörg Bornemann <[email protected]>
Diffstat (limited to 'examples/qml')
27 files changed, 88 insertions, 222 deletions
diff --git a/examples/qml/CMakeLists.txt b/examples/qml/CMakeLists.txt index 7f84d6e257..459fe041c9 100644 --- a/examples/qml/CMakeLists.txt +++ b/examples/qml/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from qml.pro. - qt_internal_add_example(dynamicscene) add_subdirectory(referenceexamples) add_subdirectory(tutorials) diff --git a/examples/qml/dynamicscene/CMakeLists.txt b/examples/qml/dynamicscene/CMakeLists.txt index 623ab1f78b..b76a096631 100644 --- a/examples/qml/dynamicscene/CMakeLists.txt +++ b/examples/qml/dynamicscene/CMakeLists.txt @@ -5,12 +5,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}/qml/dynamicscene") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(dynamicsceneexample WIN32 MACOSX_BUNDLE main.cpp) diff --git a/examples/qml/networkaccessmanagerfactory/CMakeLists.txt b/examples/qml/networkaccessmanagerfactory/CMakeLists.txt index fd4444a99b..b0b0109899 100644 --- a/examples/qml/networkaccessmanagerfactory/CMakeLists.txt +++ b/examples/qml/networkaccessmanagerfactory/CMakeLists.txt @@ -1,33 +1,25 @@ -# Generated from networkaccessmanagerfactory.pro. - cmake_minimum_required(VERSION 3.16) project(networkaccessmanagerfactory LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/networkaccessmanagerfactory") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) -find_package(Qt6 COMPONENTS Network) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Qml Quick) qt_add_executable(networkaccessmanagerfactory main.cpp ) + set_target_properties(networkaccessmanagerfactory PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(networkaccessmanagerfactory PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/qmldom/CMakeLists.txt b/examples/qml/qmldom/CMakeLists.txt index 975f3630bb..ed2ede65b0 100644 --- a/examples/qml/qmldom/CMakeLists.txt +++ b/examples/qml/qmldom/CMakeLists.txt @@ -1,17 +1,15 @@ cmake_minimum_required(VERSION 3.18) project(qmldomloadeditwrite LANGUAGES CXX) -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}/qml/qmldomloadeditwrite") -find_package(Qt6 COMPONENTS Core Gui Qml Network) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Network Qml) add_compile_definitions( QT_QMLTEST_DATADIR="${CMAKE_CURRENT_SOURCE_DIR}/../../../tests/auto/qmldom/domdata" diff --git a/examples/qml/qmlextensionplugins/CMakeLists.txt b/examples/qml/qmlextensionplugins/CMakeLists.txt index 8156f23eb1..d7eafd7f16 100644 --- a/examples/qml/qmlextensionplugins/CMakeLists.txt +++ b/examples/qml/qmlextensionplugins/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from qmlextensionplugins.pro. - cmake_minimum_required(VERSION 3.16) project(qmlqtimeexample LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/qmlextensionplugins/imports/TimeExample") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) set(qml_files imports/TimeExample/Clock.qml ) + set(images imports/TimeExample/center.png imports/TimeExample/clock.png imports/TimeExample/hour.png imports/TimeExample/minute.png ) + foreach(file IN LISTS qml_files images) get_filename_component(filename ${file} NAME) set_source_files_properties(${file} PROPERTIES QT_RESOURCE_ALIAS ${filename}) @@ -41,10 +35,12 @@ qt6_add_qml_module(qmlqtimeexample QML_FILES ${qml_files} RESOURCES ${images} ) + set_target_properties(qmlqtimeexample PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(qmlqtimeexample PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/CMakeLists.txt b/examples/qml/referenceexamples/CMakeLists.txt index 9347c18fba..2316bbbb9e 100644 --- a/examples/qml/referenceexamples/CMakeLists.txt +++ b/examples/qml/referenceexamples/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from referenceexamples.pro. - qt_internal_add_example(adding) qt_internal_add_example(coercion) qt_internal_add_example(default) diff --git a/examples/qml/referenceexamples/adding/CMakeLists.txt b/examples/qml/referenceexamples/adding/CMakeLists.txt index b86d90a4c3..8e5e4942e3 100644 --- a/examples/qml/referenceexamples/adding/CMakeLists.txt +++ b/examples/qml/referenceexamples/adding/CMakeLists.txt @@ -1,31 +1,26 @@ -# Generated from adding.pro. - cmake_minimum_required(VERSION 3.16) project(adding LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/adding") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(adding main.cpp person.cpp person.h ) + set_target_properties(adding PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(adding PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/referenceexamples/attached/CMakeLists.txt b/examples/qml/referenceexamples/attached/CMakeLists.txt index 4d49cc5663..b1688819e8 100644 --- a/examples/qml/referenceexamples/attached/CMakeLists.txt +++ b/examples/qml/referenceexamples/attached/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from attached.pro. - cmake_minimum_required(VERSION 3.16) project(attached LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/attached") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(attached birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(attached PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(attached PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/binding/CMakeLists.txt b/examples/qml/referenceexamples/binding/CMakeLists.txt index 2a2d6575c0..5e33d8a97e 100644 --- a/examples/qml/referenceexamples/binding/CMakeLists.txt +++ b/examples/qml/referenceexamples/binding/CMakeLists.txt @@ -1,23 +1,15 @@ -# Generated from binding.pro. - cmake_minimum_required(VERSION 3.16) project(binding LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/binding") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(binding birthdayparty.cpp birthdayparty.h @@ -25,10 +17,12 @@ qt_add_executable(binding main.cpp person.cpp person.h ) + set_target_properties(binding PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(binding PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/coercion/CMakeLists.txt b/examples/qml/referenceexamples/coercion/CMakeLists.txt index b9613de116..db54f204aa 100644 --- a/examples/qml/referenceexamples/coercion/CMakeLists.txt +++ b/examples/qml/referenceexamples/coercion/CMakeLists.txt @@ -1,32 +1,27 @@ -# Generated from coercion.pro. - cmake_minimum_required(VERSION 3.16) project(coercion LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/coercion") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(coercion birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(coercion PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(coercion PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/referenceexamples/default/CMakeLists.txt b/examples/qml/referenceexamples/default/CMakeLists.txt index 419b14d464..712266aa50 100644 --- a/examples/qml/referenceexamples/default/CMakeLists.txt +++ b/examples/qml/referenceexamples/default/CMakeLists.txt @@ -1,32 +1,27 @@ -# Generated from default.pro. - cmake_minimum_required(VERSION 3.16) project(default LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/default") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(default birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(default PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(default PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/referenceexamples/extended/CMakeLists.txt b/examples/qml/referenceexamples/extended/CMakeLists.txt index ea659e5f71..285d030ead 100644 --- a/examples/qml/referenceexamples/extended/CMakeLists.txt +++ b/examples/qml/referenceexamples/extended/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from extended.pro. - cmake_minimum_required(VERSION 3.16) project(extended LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/extended") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Widgets) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Widgets) qt_add_executable(extended lineedit.cpp lineedit.h main.cpp ) + set_target_properties(extended PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(extended PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/grouped/CMakeLists.txt b/examples/qml/referenceexamples/grouped/CMakeLists.txt index f7a31d9c1e..c0090cf59b 100644 --- a/examples/qml/referenceexamples/grouped/CMakeLists.txt +++ b/examples/qml/referenceexamples/grouped/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from grouped.pro. - cmake_minimum_required(VERSION 3.16) project(grouped LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/grouped") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(grouped birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(grouped PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(grouped PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/methods/CMakeLists.txt b/examples/qml/referenceexamples/methods/CMakeLists.txt index 304aa3082a..ded6d125cc 100644 --- a/examples/qml/referenceexamples/methods/CMakeLists.txt +++ b/examples/qml/referenceexamples/methods/CMakeLists.txt @@ -1,32 +1,27 @@ -# Generated from methods.pro. - cmake_minimum_required(VERSION 3.16) project(methods LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/methods") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(methods birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(methods PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(methods PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/referenceexamples/properties/CMakeLists.txt b/examples/qml/referenceexamples/properties/CMakeLists.txt index 11f70f337f..ffd2d86a14 100644 --- a/examples/qml/referenceexamples/properties/CMakeLists.txt +++ b/examples/qml/referenceexamples/properties/CMakeLists.txt @@ -1,32 +1,27 @@ -# Generated from properties.pro. - cmake_minimum_required(VERSION 3.16) project(properties LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/properties") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(properties birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(properties PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(properties PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/referenceexamples/signal/CMakeLists.txt b/examples/qml/referenceexamples/signal/CMakeLists.txt index 23e494f7c9..77525bfed6 100644 --- a/examples/qml/referenceexamples/signal/CMakeLists.txt +++ b/examples/qml/referenceexamples/signal/CMakeLists.txt @@ -1,33 +1,27 @@ -# Generated from signal.pro. - cmake_minimum_required(VERSION 3.16) project(signal LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/signal") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(signal birthdayparty.cpp birthdayparty.h main.cpp person.cpp person.h ) + set_target_properties(signal PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(signal PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/referenceexamples/valuesource/CMakeLists.txt b/examples/qml/referenceexamples/valuesource/CMakeLists.txt index 3e997bb8f8..9901ac6cdf 100644 --- a/examples/qml/referenceexamples/valuesource/CMakeLists.txt +++ b/examples/qml/referenceexamples/valuesource/CMakeLists.txt @@ -1,23 +1,15 @@ -# Generated from valuesource.pro. - cmake_minimum_required(VERSION 3.16) project(valuesource LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/valuesource") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Gui) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml) qt_add_executable(valuesource birthdayparty.cpp birthdayparty.h @@ -25,10 +17,12 @@ qt_add_executable(valuesource main.cpp person.cpp person.h ) + set_target_properties(valuesource PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(valuesource PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/shell/CMakeLists.txt b/examples/qml/shell/CMakeLists.txt index c048159fc4..48e62204cd 100644 --- a/examples/qml/shell/CMakeLists.txt +++ b/examples/qml/shell/CMakeLists.txt @@ -1,30 +1,25 @@ -# Generated from shell.pro. - cmake_minimum_required(VERSION 3.16) project(shell LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/shell") -find_package(Qt6 COMPONENTS Core) -find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Qml) qt_add_executable(shell main.cpp ) + set_target_properties(shell PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(shell PUBLIC Qt::Core Qt::Qml diff --git a/examples/qml/tutorials/CMakeLists.txt b/examples/qml/tutorials/CMakeLists.txt index 0aa8ff83e8..ca0c4124aa 100644 --- a/examples/qml/tutorials/CMakeLists.txt +++ b/examples/qml/tutorials/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from tutorials.pro. - if(TARGET Qt::Quick) add_subdirectory(extending-qml) endif() diff --git a/examples/qml/tutorials/extending-qml/CMakeLists.txt b/examples/qml/tutorials/extending-qml/CMakeLists.txt index fc41f09986..6416970715 100644 --- a/examples/qml/tutorials/extending-qml/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/CMakeLists.txt @@ -1,5 +1,3 @@ -# Generated from extending-qml.pro. - qt_internal_add_example(chapter1-basics) qt_internal_add_example(chapter2-methods) qt_internal_add_example(chapter3-bindings) diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt index c04b465254..088b102c39 100644 --- a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from chapter1-basics.pro. - cmake_minimum_required(VERSION 3.16) project(chapter1-basics LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter1-basics") -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(chapter1-basics main.cpp piechart.cpp piechart.h ) + set_target_properties(chapter1-basics PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter1-basics PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt index 993c235965..f6eee234bc 100644 --- a/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from chapter2-methods.pro. - cmake_minimum_required(VERSION 3.16) project(chapter2-methods LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter2-methods") -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(chapter2-methods main.cpp piechart.cpp piechart.h ) + set_target_properties(chapter2-methods PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter2-methods PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt index f600ae5389..585821669b 100644 --- a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt @@ -1,33 +1,26 @@ -# Generated from chapter3-bindings.pro. - cmake_minimum_required(VERSION 3.16) project(chapter3-bindings LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter3-bindings") -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(chapter3-bindings main.cpp piechart.cpp piechart.h ) + set_target_properties(chapter3-bindings PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter3-bindings PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt index 50e231bb7d..80429fdf60 100644 --- a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt @@ -1,34 +1,27 @@ -# Generated from chapter4-customPropertyTypes.pro. - cmake_minimum_required(VERSION 3.16) project(chapter4-customPropertyTypes LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter4-customPropertyTypes") -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(chapter4-customPropertyTypes main.cpp piechart.cpp piechart.h pieslice.cpp pieslice.h ) + set_target_properties(chapter4-customPropertyTypes PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter4-customPropertyTypes PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt index 1891bc34d5..e5a843efb4 100644 --- a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt @@ -1,34 +1,27 @@ -# Generated from chapter5-listproperties.pro. - cmake_minimum_required(VERSION 3.16) project(chapter5-listproperties LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter5-listproperties") -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(chapter5-listproperties main.cpp piechart.cpp piechart.h pieslice.cpp pieslice.h ) + set_target_properties(chapter5-listproperties PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter5-listproperties PUBLIC Qt::Core Qt::Gui diff --git a/examples/qml/tutorials/extending-qml/chapter6-plugins/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter6-plugins/CMakeLists.txt index dc0b20dc21..85311bfc3e 100644 --- a/examples/qml/tutorials/extending-qml/chapter6-plugins/CMakeLists.txt +++ b/examples/qml/tutorials/extending-qml/chapter6-plugins/CMakeLists.txt @@ -1,30 +1,25 @@ -# Generated from chapter6-plugins.pro. - cmake_minimum_required(VERSION 3.16) project(chapter6-plugins LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/tutorials/extending-qml/chapter6-plugins") -find_package(Qt6 COMPONENTS Qml) -find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 REQUIRED COMPONENTS Qml Quick) qt_add_executable(chapter6-plugins main.cpp ) + set_target_properties(chapter6-plugins PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE ) + target_link_libraries(chapter6-plugins PRIVATE Qt::Qml Qt::Quick diff --git a/examples/qml/xmlhttprequest/CMakeLists.txt b/examples/qml/xmlhttprequest/CMakeLists.txt index a3fe890634..0c0f7df72d 100644 --- a/examples/qml/xmlhttprequest/CMakeLists.txt +++ b/examples/qml/xmlhttprequest/CMakeLists.txt @@ -1,20 +1,15 @@ -# Generated from xmlhttprequest.pro. - cmake_minimum_required(VERSION 3.16) project(xmlhttprequest LANGUAGES CXX) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) if(NOT DEFINED INSTALL_EXAMPLESDIR) - set(INSTALL_EXAMPLESDIR "examples") + set(INSTALL_EXAMPLESDIR "examples") endif() set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/qml/xmlhttprequest") -find_package(Qt6 COMPONENTS Core Gui Quick Qml) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Qml Quick) qt_add_executable(xmlhttprequestexample WIN32 |