From b938edcfb3aa2c78e35c9d63d995f6824e14eadf Mon Sep 17 00:00:00 2001 From: Leander Beernaert Date: Thu, 22 Aug 2019 11:45:45 +0200 Subject: Convert Examples This patch converts all examples in qtdeclarative except for a few exceptions which require a public facing qml plugin api. Change-Id: I2cd2b1bb455be8b48796893a8235dea7f8b35aa2 Reviewed-by: Alexandru Croitor --- examples/qml/.prev_CMakeLists.txt | 12 +++ examples/qml/CMakeLists.txt | 21 +++-- .../qml/networkaccessmanagerfactory/CMakeLists.txt | 48 ++++++++++ examples/qml/referenceexamples/CMakeLists.txt | 30 +++--- .../qml/referenceexamples/adding/CMakeLists.txt | 52 +++++++--- .../qml/referenceexamples/attached/CMakeLists.txt | 46 +++++++++ .../qml/referenceexamples/binding/CMakeLists.txt | 47 +++++++++ .../qml/referenceexamples/coercion/CMakeLists.txt | 44 +++++++++ .../qml/referenceexamples/default/CMakeLists.txt | 44 +++++++++ .../qml/referenceexamples/extended/CMakeLists.txt | 47 +++++++++ .../qml/referenceexamples/grouped/CMakeLists.txt | 46 +++++++++ .../qml/referenceexamples/methods/CMakeLists.txt | 44 +++++++++ .../referenceexamples/properties/CMakeLists.txt | 44 +++++++++ .../qml/referenceexamples/signal/CMakeLists.txt | 46 +++++++++ .../referenceexamples/valuesource/CMakeLists.txt | 47 +++++++++ examples/qml/shell/CMakeLists.txt | 41 ++++---- examples/qml/tutorials/CMakeLists.txt | 5 + .../tutorials/extending-qml/.prev_CMakeLists.txt | 8 ++ .../qml/tutorials/extending-qml/CMakeLists.txt | 11 +++ .../extending-qml/chapter1-basics/CMakeLists.txt | 47 +++++++++ .../extending-qml/chapter2-methods/CMakeLists.txt | 47 +++++++++ .../extending-qml/chapter3-bindings/CMakeLists.txt | 47 +++++++++ .../chapter4-customPropertyTypes/CMakeLists.txt | 48 ++++++++++ .../chapter5-listproperties/CMakeLists.txt | 48 ++++++++++ examples/qml/xmlhttprequest/CMakeLists.txt | 105 +++++++++++++++++++++ 25 files changed, 966 insertions(+), 59 deletions(-) create mode 100644 examples/qml/.prev_CMakeLists.txt create mode 100644 examples/qml/networkaccessmanagerfactory/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/attached/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/binding/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/coercion/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/default/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/extended/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/grouped/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/methods/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/properties/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/signal/CMakeLists.txt create mode 100644 examples/qml/referenceexamples/valuesource/CMakeLists.txt create mode 100644 examples/qml/tutorials/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt create mode 100644 examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt create mode 100644 examples/qml/xmlhttprequest/CMakeLists.txt (limited to 'examples/qml') diff --git a/examples/qml/.prev_CMakeLists.txt b/examples/qml/.prev_CMakeLists.txt new file mode 100644 index 0000000000..0ec4c9b39d --- /dev/null +++ b/examples/qml/.prev_CMakeLists.txt @@ -0,0 +1,12 @@ +# Generated from qml.pro. + +add_subdirectory(referenceexamples) +add_subdirectory(tutorials) +add_subdirectory(shell) +if(TARGET Qt::Quick) + add_subdirectory(qmlextensionplugins) + add_subdirectory(xmlhttprequest) +endif() +if(QT_FEATURE_qml_network AND TARGET Qt::Quick) + add_subdirectory(networkaccessmanagerfactory) +endif() diff --git a/examples/qml/CMakeLists.txt b/examples/qml/CMakeLists.txt index 496d36ba21..8ff3b7aa9b 100644 --- a/examples/qml/CMakeLists.txt +++ b/examples/qml/CMakeLists.txt @@ -1,14 +1,15 @@ # Generated from qml.pro. add_subdirectory(referenceexamples) -#add_subdirectory(tutorials) +add_subdirectory(tutorials) add_subdirectory(shell) - -#if(TARGET Qt::Quick) - #add_subdirectory(qmlextensionplugins) - #add_subdirectory(xmlhttprequest) - - #if(QT_FEATURE_qml_network) - #add_subdirectory(networkaccessmanagerfactory) - #endif() -#endif() +if(TARGET Qt::Quick) +# special case begin +# Needs public QML api +# add_subdirectory(qmlextensionplugins) +# special case end + add_subdirectory(xmlhttprequest) +endif() +if(QT_FEATURE_qml_network AND TARGET Qt::Quick) + add_subdirectory(networkaccessmanagerfactory) +endif() diff --git a/examples/qml/networkaccessmanagerfactory/CMakeLists.txt b/examples/qml/networkaccessmanagerfactory/CMakeLists.txt new file mode 100644 index 0000000000..f1871ea9be --- /dev/null +++ b/examples/qml/networkaccessmanagerfactory/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from networkaccessmanagerfactory.pro. + +cmake_minimum_required(VERSION 3.14) +project(networkaccessmanagerfactory LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +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) + +add_qt_gui_executable(networkaccessmanagerfactory + main.cpp +) +target_link_libraries(networkaccessmanagerfactory PUBLIC + Qt::Core + Qt::Gui + Qt::Network + Qt::Qml + Qt::Quick +) + +# Resources: +set(networkaccessmanagerfactory_resource_files + "view.qml" +) + +QT6_ADD_RESOURCES(networkaccessmanagerfactory "networkaccessmanagerfactory" + PREFIX + "/" + FILES + ${networkaccessmanagerfactory_resource_files} +) + + +install(TARGETS networkaccessmanagerfactory + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/CMakeLists.txt b/examples/qml/referenceexamples/CMakeLists.txt index f7ba5c0565..827e3b0060 100644 --- a/examples/qml/referenceexamples/CMakeLists.txt +++ b/examples/qml/referenceexamples/CMakeLists.txt @@ -1,19 +1,17 @@ # Generated from referenceexamples.pro. add_subdirectory(adding) -#add_subdirectory(coercion) -#add_subdirectory(default) -#add_subdirectory(properties) -#add_subdirectory(methods) - -#if(TARGET Qt::Widgets) - #add_subdirectory(extended) -#endif() - -#if(TARGET Qt::Quick) - #add_subdirectory(attached) - #add_subdirectory(binding) - #add_subdirectory(grouped) - #add_subdirectory(signal) - #add_subdirectory(valuesource) -#endif() +add_subdirectory(coercion) +add_subdirectory(default) +add_subdirectory(properties) +add_subdirectory(methods) +if(TARGET Qt::Widgets) + add_subdirectory(extended) +endif() +if(TARGET Qt::Quick) + add_subdirectory(attached) + add_subdirectory(binding) + add_subdirectory(grouped) + add_subdirectory(signal) + add_subdirectory(valuesource) +endif() diff --git a/examples/qml/referenceexamples/adding/CMakeLists.txt b/examples/qml/referenceexamples/adding/CMakeLists.txt index 5f2b272d3f..4febb6fb06 100644 --- a/examples/qml/referenceexamples/adding/CMakeLists.txt +++ b/examples/qml/referenceexamples/adding/CMakeLists.txt @@ -1,21 +1,43 @@ # Generated from adding.pro. -##################################################################### -## adding Binary: -##################################################################### - -add_qt_executable(adding - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/adding" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/referenceexamples/adding" - SOURCES - main.cpp - person.cpp person.h - PUBLIC_LIBRARIES - Qt::Qml +cmake_minimum_required(VERSION 3.14) +project(adding LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(adding + main.cpp + person.cpp person.h +) +target_link_libraries(adding PUBLIC + Qt::Core + Qt::Qml ) # Resources: -add_qt_resource(adding "adding" FILES - example.qml) +set(adding_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(adding "adding" + PREFIX + "/" + FILES + ${adding_resource_files} +) + +install(TARGETS adding + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/attached/CMakeLists.txt b/examples/qml/referenceexamples/attached/CMakeLists.txt new file mode 100644 index 0000000000..4d17701aac --- /dev/null +++ b/examples/qml/referenceexamples/attached/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from attached.pro. + +cmake_minimum_required(VERSION 3.14) +project(attached LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(attached + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(attached PUBLIC + Qt::Core + Qt::Gui + Qt::Qml +) + +# Resources: +set(attached_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(attached "attached" + PREFIX + "/" + FILES + ${attached_resource_files} +) + + +install(TARGETS attached + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/binding/CMakeLists.txt b/examples/qml/referenceexamples/binding/CMakeLists.txt new file mode 100644 index 0000000000..e117e71b01 --- /dev/null +++ b/examples/qml/referenceexamples/binding/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from binding.pro. + +cmake_minimum_required(VERSION 3.14) +project(binding LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(binding + birthdayparty.cpp birthdayparty.h + happybirthdaysong.cpp happybirthdaysong.h + main.cpp + person.cpp person.h +) +target_link_libraries(binding PUBLIC + Qt::Core + Qt::Gui + Qt::Qml +) + +# Resources: +set(binding_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(binding "binding" + PREFIX + "/" + FILES + ${binding_resource_files} +) + + +install(TARGETS binding + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/coercion/CMakeLists.txt b/examples/qml/referenceexamples/coercion/CMakeLists.txt new file mode 100644 index 0000000000..57307576a1 --- /dev/null +++ b/examples/qml/referenceexamples/coercion/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from coercion.pro. + +cmake_minimum_required(VERSION 3.14) +project(coercion LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(coercion + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(coercion PUBLIC + Qt::Core + Qt::Qml +) + +# Resources: +set(coercion_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(coercion "coercion" + PREFIX + "/" + FILES + ${coercion_resource_files} +) + + +install(TARGETS coercion + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/default/CMakeLists.txt b/examples/qml/referenceexamples/default/CMakeLists.txt new file mode 100644 index 0000000000..2ed8122110 --- /dev/null +++ b/examples/qml/referenceexamples/default/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from default.pro. + +cmake_minimum_required(VERSION 3.14) +project(default LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(default + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(default PUBLIC + Qt::Core + Qt::Qml +) + +# Resources: +set(default_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(default "default" + PREFIX + "/" + FILES + ${default_resource_files} +) + + +install(TARGETS default + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/extended/CMakeLists.txt b/examples/qml/referenceexamples/extended/CMakeLists.txt new file mode 100644 index 0000000000..e44df6ed1f --- /dev/null +++ b/examples/qml/referenceexamples/extended/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from extended.pro. + +cmake_minimum_required(VERSION 3.14) +project(extended LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Widgets) + +add_qt_gui_executable(extended + lineedit.cpp lineedit.h + main.cpp +) +target_link_libraries(extended PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Widgets +) + +# Resources: +set(extended_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(extended "extended" + PREFIX + "/" + FILES + ${extended_resource_files} +) + + +install(TARGETS extended + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/grouped/CMakeLists.txt b/examples/qml/referenceexamples/grouped/CMakeLists.txt new file mode 100644 index 0000000000..425c04c89c --- /dev/null +++ b/examples/qml/referenceexamples/grouped/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from grouped.pro. + +cmake_minimum_required(VERSION 3.14) +project(grouped LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(grouped + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(grouped PUBLIC + Qt::Core + Qt::Gui + Qt::Qml +) + +# Resources: +set(grouped_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(grouped "grouped" + PREFIX + "/" + FILES + ${grouped_resource_files} +) + + +install(TARGETS grouped + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/methods/CMakeLists.txt b/examples/qml/referenceexamples/methods/CMakeLists.txt new file mode 100644 index 0000000000..91b26a8726 --- /dev/null +++ b/examples/qml/referenceexamples/methods/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from methods.pro. + +cmake_minimum_required(VERSION 3.14) +project(methods LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(methods + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(methods PUBLIC + Qt::Core + Qt::Qml +) + +# Resources: +set(methods_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(methods "methods" + PREFIX + "/" + FILES + ${methods_resource_files} +) + + +install(TARGETS methods + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/properties/CMakeLists.txt b/examples/qml/referenceexamples/properties/CMakeLists.txt new file mode 100644 index 0000000000..2fd2e346b7 --- /dev/null +++ b/examples/qml/referenceexamples/properties/CMakeLists.txt @@ -0,0 +1,44 @@ +# Generated from properties.pro. + +cmake_minimum_required(VERSION 3.14) +project(properties LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(properties + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(properties PUBLIC + Qt::Core + Qt::Qml +) + +# Resources: +set(properties_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(properties "properties" + PREFIX + "/" + FILES + ${properties_resource_files} +) + + +install(TARGETS properties + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/signal/CMakeLists.txt b/examples/qml/referenceexamples/signal/CMakeLists.txt new file mode 100644 index 0000000000..b619a922de --- /dev/null +++ b/examples/qml/referenceexamples/signal/CMakeLists.txt @@ -0,0 +1,46 @@ +# Generated from signal.pro. + +cmake_minimum_required(VERSION 3.14) +project(signal LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(signal + birthdayparty.cpp birthdayparty.h + main.cpp + person.cpp person.h +) +target_link_libraries(signal PUBLIC + Qt::Core + Qt::Gui + Qt::Qml +) + +# Resources: +set(signal_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(signal "signal" + PREFIX + "/" + FILES + ${signal_resource_files} +) + + +install(TARGETS signal + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/referenceexamples/valuesource/CMakeLists.txt b/examples/qml/referenceexamples/valuesource/CMakeLists.txt new file mode 100644 index 0000000000..dfe31f8e3e --- /dev/null +++ b/examples/qml/referenceexamples/valuesource/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from valuesource.pro. + +cmake_minimum_required(VERSION 3.14) +project(valuesource LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(valuesource + birthdayparty.cpp birthdayparty.h + happybirthdaysong.cpp happybirthdaysong.h + main.cpp + person.cpp person.h +) +target_link_libraries(valuesource PUBLIC + Qt::Core + Qt::Gui + Qt::Qml +) + +# Resources: +set(valuesource_resource_files + "example.qml" +) + +QT6_ADD_RESOURCES(valuesource "valuesource" + PREFIX + "/" + FILES + ${valuesource_resource_files} +) + + +install(TARGETS valuesource + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/shell/CMakeLists.txt b/examples/qml/shell/CMakeLists.txt index 2b3bdd4786..0c376e323a 100644 --- a/examples/qml/shell/CMakeLists.txt +++ b/examples/qml/shell/CMakeLists.txt @@ -1,24 +1,29 @@ # Generated from shell.pro. -##################################################################### -## shell Binary: -##################################################################### +cmake_minimum_required(VERSION 3.14) +project(shell LANGUAGES CXX) -add_qt_executable(shell - GUI - OUTPUT_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/shell" - INSTALL_DIRECTORY "${INSTALL_EXAMPLESDIR}/qml/shell" - SOURCES - main.cpp - PUBLIC_LIBRARIES - Qt::Qml -) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") -## Scopes: -##################################################################### +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Qml) -#### Keys ignored in scope 2:.:.:shell.pro:WIN32: -# CONFIG = "console" +add_qt_gui_executable(shell + main.cpp +) +target_link_libraries(shell PUBLIC + Qt::Core + Qt::Qml +) -#### Keys ignored in scope 3:.:.:shell.pro:APPLE_OSX: -# CONFIG = "-app_bundle" +install(TARGETS shell + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/tutorials/CMakeLists.txt b/examples/qml/tutorials/CMakeLists.txt new file mode 100644 index 0000000000..0aa8ff83e8 --- /dev/null +++ b/examples/qml/tutorials/CMakeLists.txt @@ -0,0 +1,5 @@ +# Generated from tutorials.pro. + +if(TARGET Qt::Quick) + add_subdirectory(extending-qml) +endif() diff --git a/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt b/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt new file mode 100644 index 0000000000..8e41f3d77d --- /dev/null +++ b/examples/qml/tutorials/extending-qml/.prev_CMakeLists.txt @@ -0,0 +1,8 @@ +# Generated from extending-qml.pro. + +add_subdirectory(chapter1-basics) +add_subdirectory(chapter2-methods) +add_subdirectory(chapter3-bindings) +add_subdirectory(chapter4-customPropertyTypes) +add_subdirectory(chapter5-listproperties) +add_subdirectory(chapter6-plugins) diff --git a/examples/qml/tutorials/extending-qml/CMakeLists.txt b/examples/qml/tutorials/extending-qml/CMakeLists.txt new file mode 100644 index 0000000000..8f8395ac95 --- /dev/null +++ b/examples/qml/tutorials/extending-qml/CMakeLists.txt @@ -0,0 +1,11 @@ +# Generated from extending-qml.pro. + +add_subdirectory(chapter1-basics) +add_subdirectory(chapter2-methods) +add_subdirectory(chapter3-bindings) +add_subdirectory(chapter4-customPropertyTypes) +add_subdirectory(chapter5-listproperties) +# special case begin +# Needs public QML plugin API +# add_subdirectory(chapter6-plugins) +# special case end diff --git a/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt new file mode 100644 index 0000000000..f015666898 --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter1-basics/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from chapter1-basics.pro. + +cmake_minimum_required(VERSION 3.14) +project(chapter1-basics LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) + +add_qt_gui_executable(chapter1-basics + main.cpp + piechart.cpp piechart.h +) +target_link_libraries(chapter1-basics PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(chapter1-basics_resource_files + "app.qml" +) + +QT6_ADD_RESOURCES(chapter1-basics "chapter1-basics" + PREFIX + "/" + FILES + ${chapter1-basics_resource_files} +) + + +install(TARGETS chapter1-basics + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt new file mode 100644 index 0000000000..7b3a241db5 --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter2-methods/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from chapter2-methods.pro. + +cmake_minimum_required(VERSION 3.14) +project(chapter2-methods LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) + +add_qt_gui_executable(chapter2-methods + main.cpp + piechart.cpp piechart.h +) +target_link_libraries(chapter2-methods PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(chapter2-methods_resource_files + "app.qml" +) + +QT6_ADD_RESOURCES(chapter2-methods "chapter2-methods" + PREFIX + "/" + FILES + ${chapter2-methods_resource_files} +) + + +install(TARGETS chapter2-methods + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt new file mode 100644 index 0000000000..7321e4adbc --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter3-bindings/CMakeLists.txt @@ -0,0 +1,47 @@ +# Generated from chapter3-bindings.pro. + +cmake_minimum_required(VERSION 3.14) +project(chapter3-bindings LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) + +add_qt_gui_executable(chapter3-bindings + main.cpp + piechart.cpp piechart.h +) +target_link_libraries(chapter3-bindings PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(chapter3-bindings_resource_files + "app.qml" +) + +QT6_ADD_RESOURCES(chapter3-bindings "chapter3-bindings" + PREFIX + "/" + FILES + ${chapter3-bindings_resource_files} +) + + +install(TARGETS chapter3-bindings + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt new file mode 100644 index 0000000000..5aea87d6e1 --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter4-customPropertyTypes/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from chapter4-customPropertyTypes.pro. + +cmake_minimum_required(VERSION 3.14) +project(chapter4-customPropertyTypes LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) + +add_qt_gui_executable(chapter4-customPropertyTypes + main.cpp + piechart.cpp piechart.h + pieslice.cpp pieslice.h +) +target_link_libraries(chapter4-customPropertyTypes PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(chapter4-customPropertyTypes_resource_files + "app.qml" +) + +QT6_ADD_RESOURCES(chapter4-customPropertyTypes "chapter4-customPropertyTypes" + PREFIX + "/" + FILES + ${chapter4-customPropertyTypes_resource_files} +) + + +install(TARGETS chapter4-customPropertyTypes + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt new file mode 100644 index 0000000000..38b7f4b52c --- /dev/null +++ b/examples/qml/tutorials/extending-qml/chapter5-listproperties/CMakeLists.txt @@ -0,0 +1,48 @@ +# Generated from chapter5-listproperties.pro. + +cmake_minimum_required(VERSION 3.14) +project(chapter5-listproperties LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Qml) +find_package(Qt6 COMPONENTS Quick) + +add_qt_gui_executable(chapter5-listproperties + main.cpp + piechart.cpp piechart.h + pieslice.cpp pieslice.h +) +target_link_libraries(chapter5-listproperties PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(chapter5-listproperties_resource_files + "app.qml" +) + +QT6_ADD_RESOURCES(chapter5-listproperties "chapter5-listproperties" + PREFIX + "/" + FILES + ${chapter5-listproperties_resource_files} +) + + +install(TARGETS chapter5-listproperties + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) diff --git a/examples/qml/xmlhttprequest/CMakeLists.txt b/examples/qml/xmlhttprequest/CMakeLists.txt new file mode 100644 index 0000000000..aa2fc5fc11 --- /dev/null +++ b/examples/qml/xmlhttprequest/CMakeLists.txt @@ -0,0 +1,105 @@ +# Generated from xmlhttprequest.pro. + +cmake_minimum_required(VERSION 3.14) +project(xmlhttprequest LANGUAGES CXX) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +set(INSTALL_EXAMPLEDIR "examples") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Quick) +find_package(Qt6 COMPONENTS Qml) + +add_qt_gui_executable(xmlhttprequest + main.cpp +) +target_link_libraries(xmlhttprequest PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +# Resources: +set(xmlhttprequest_resource_files + "Get.qml" + "GetForm.ui.qml" + "data.xml" + "methods.js" + "xmlhttprequest.qml" +) + +QT6_ADD_RESOURCES(xmlhttprequest "xmlhttprequest" + PREFIX + "/qml/xmlhttprequest" + FILES + ${xmlhttprequest_resource_files} +) +set_source_files_properties("../../quick/shared/Button.qml" + PROPERTIES QT_RESOURCE_ALIAS "Button.qml" +) +set_source_files_properties("../../quick/shared/CheckBox.qml" + PROPERTIES QT_RESOURCE_ALIAS "CheckBox.qml" +) +set_source_files_properties("../../quick/shared/Label.qml" + PROPERTIES QT_RESOURCE_ALIAS "Label.qml" +) +set_source_files_properties("../../quick/shared/LauncherList.qml" + PROPERTIES QT_RESOURCE_ALIAS "LauncherList.qml" +) +set_source_files_properties("../../quick/shared/SimpleLauncherDelegate.qml" + PROPERTIES QT_RESOURCE_ALIAS "SimpleLauncherDelegate.qml" +) +set_source_files_properties("../../quick/shared/Slider.qml" + PROPERTIES QT_RESOURCE_ALIAS "Slider.qml" +) +set_source_files_properties("../../quick/shared/TextField.qml" + PROPERTIES QT_RESOURCE_ALIAS "TextField.qml" +) +set_source_files_properties("../../quick/shared/images/back.png" + PROPERTIES QT_RESOURCE_ALIAS "images/back.png" +) +set_source_files_properties("../../quick/shared/images/checkmark.png" + PROPERTIES QT_RESOURCE_ALIAS "images/checkmark.png" +) +set_source_files_properties("../../quick/shared/images/next.png" + PROPERTIES QT_RESOURCE_ALIAS "images/next.png" +) +set_source_files_properties("../../quick/shared/images/slider_handle.png" + PROPERTIES QT_RESOURCE_ALIAS "images/slider_handle.png" +) +set(quick_shared_resource_files + "Button.qml" + "CheckBox.qml" + "Label.qml" + "LauncherList.qml" + "SimpleLauncherDelegate.qml" + "Slider.qml" + "TextField.qml" + "images/back.png" + "images/checkmark.png" + "images/next.png" + "images/slider_handle.png" +) + +QT6_ADD_RESOURCES(xmlhttprequest "quick_shared" + PREFIX + "/quick/shared" + BASE + "../../quick/shared" + FILES + ${quick_shared_resource_files} +) + + +install(TARGETS xmlhttprequest + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) -- cgit v1.2.3