diff options
author | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2020-12-23 11:45:29 +0100 |
---|---|---|
committer | Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> | 2020-12-23 16:08:11 +0100 |
commit | 4c6eb929ebe570115c65c7fc47e9b749435aa419 (patch) | |
tree | ad49f1f4fe6e51fdeceec7d64e2f41e0e5b6af4c | |
parent | 90e38c8555d0f7a33ab49e14c70c0d43f8f143b0 (diff) |
Add CMake port based on the qmake setup
Change-Id: I45db1cb367fafb5d5a68af283c20eecabad0fd25
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
-rw-r--r-- | .cmake.conf | 1 | ||||
-rw-r--r-- | CMakeLists.txt | 19 | ||||
-rw-r--r-- | examples/CMakeLists.txt | 7 | ||||
-rw-r--r-- | examples/quickcalendar/CMakeLists.txt | 3 | ||||
-rw-r--r-- | examples/quickcalendar/eventcalendar/CMakeLists.txt | 66 | ||||
-rw-r--r-- | src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/imports/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/imports/calendar/CMakeLists.txt | 67 | ||||
-rw-r--r-- | tests/CMakeLists.txt | 7 | ||||
-rw-r--r-- | tests/auto/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/auto/calendar/CMakeLists.txt | 25 |
11 files changed, 204 insertions, 0 deletions
diff --git a/.cmake.conf b/.cmake.conf new file mode 100644 index 0000000..9305480 --- /dev/null +++ b/.cmake.conf @@ -0,0 +1 @@ +set(QT_REPO_MODULE_VERSION "6.0.0") diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d448d5b --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,19 @@ +# Generated from qtquickcalendar.pro. + +cmake_minimum_required(VERSION 3.15.0) + +include(.cmake.conf) +project(quickcalendar + VERSION "${QT_REPO_MODULE_VERSION}" + DESCRIPTION "Qt Quick Calendar Library" + HOMEPAGE_URL "https://marketplace.qt.io/products/qt-quick-calendar" + LANGUAGES CXX C +) + +find_package(Qt6 ${PROJECT_VERSION} CONFIG REQUIRED COMPONENTS BuildInternals Core QuickControls2 QuickTemplates2) + +if(NOT TARGET Qt::QuickControls2) + message(NOTICE "Skipping the build as the condition \"TARGET Qt::QuickControls2\" is not met.") + return() +endif() +qt_build_repo() diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..aef6a3b --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from examples.pro. + +qt_examples_build_begin() + +add_subdirectory(quickcalendar) + +qt_examples_build_end() diff --git a/examples/quickcalendar/CMakeLists.txt b/examples/quickcalendar/CMakeLists.txt new file mode 100644 index 0000000..cd5409a --- /dev/null +++ b/examples/quickcalendar/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from quickcalendar.pro. + +add_subdirectory(eventcalendar) diff --git a/examples/quickcalendar/eventcalendar/CMakeLists.txt b/examples/quickcalendar/eventcalendar/CMakeLists.txt new file mode 100644 index 0000000..221f234 --- /dev/null +++ b/examples/quickcalendar/eventcalendar/CMakeLists.txt @@ -0,0 +1,66 @@ +# Generated from eventcalendar.pro. + +cmake_minimum_required(VERSION 3.14) +project(eventcalendar 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") +endif() + +set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcalendar/eventcalendar") + +find_package(Qt6 COMPONENTS Core) +find_package(Qt6 COMPONENTS Gui) +find_package(Qt6 COMPONENTS Sql) +find_package(Qt6 COMPONENTS Qml) + +qt_add_executable(eventcalendar + event.h + eventcalendar.cpp + eventmodel.cpp eventmodel.h + sqleventdatabase.cpp sqleventdatabase.h +) +set_target_properties(eventcalendar PROPERTIES + WIN32_EXECUTABLE TRUE + MACOSX_BUNDLE TRUE +) +target_link_libraries(eventcalendar PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Sql +) + + +# Resources: +set(qmake_immediate_resource_files + "MonthGridDelegate.qml" + "eventcalendar.qml" + "qtquickcontrols2.conf" +) + +qt6_add_resources(eventcalendar "qmake_immediate" + PREFIX + "/" + FILES + ${qmake_immediate_resource_files} +) + +install(TARGETS eventcalendar + RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}" + BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}" + LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}" +) + +set_target_properties(eventcalendar PROPERTIES + QT_QML_MODULE_VERSION 1.0 + QT_QML_MODULE_URI App +) + +qt6_qml_type_registration(eventcalendar) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..7a9d067 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from src.pro. + +add_subdirectory(imports) diff --git a/src/imports/CMakeLists.txt b/src/imports/CMakeLists.txt new file mode 100644 index 0000000..e49d9de --- /dev/null +++ b/src/imports/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from imports.pro. + +add_subdirectory(calendar) diff --git a/src/imports/calendar/CMakeLists.txt b/src/imports/calendar/CMakeLists.txt new file mode 100644 index 0000000..0afdf4b --- /dev/null +++ b/src/imports/calendar/CMakeLists.txt @@ -0,0 +1,67 @@ +# Generated from calendar.pro. + +##################################################################### +## qtquickcalendarplugin Plugin: +##################################################################### + +qt_add_qml_module(qtquickcalendarplugin + URI "QtQuick.Calendar" + VERSION "1.0" + CLASSNAME QtQuickCalendarPlugin + SOURCES + qquickcalendar.cpp qquickcalendar_p.h + qquickcalendarmodel.cpp qquickcalendarmodel_p.h + qquickdayofweekmodel.cpp qquickdayofweekmodel_p.h + qquickdayofweekrow.cpp qquickdayofweekrow_p.h + qquickmonthgrid.cpp qquickmonthgrid_p.h + qquickmonthmodel.cpp qquickmonthmodel_p.h + qquickweeknumbercolumn.cpp qquickweeknumbercolumn_p.h + qquickweeknumbermodel.cpp qquickweeknumbermodel_p.h + qtquickcalendarplugin.cpp + DEFINES + QT_NO_CAST_FROM_ASCII + QT_NO_CAST_TO_ASCII + LIBRARIES + Qt::CorePrivate + Qt::GuiPrivate + Qt::QmlPrivate + Qt::QuickPrivate + Qt::QuickTemplates2Private + PUBLIC_LIBRARIES + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick +) + +#### Keys ignored in scope 1:.:.:calendar.pro:<TRUE>: +# IMPORT_VERSION = "1.0" +# OTHER_FILES = "qmldir" +# TARGETPATH = "QtQuick/Calendar" + +## Scopes: +##################################################################### + +set(qml_files + "DayOfWeekRow.qml" + "MonthGrid.qml" + "WeekNumberColumn.qml" +) +set_source_files_properties(DayOfWeekRow.qml PROPERTIES + QT_QML_SOURCE_VERSION "1.0" +) +set_source_files_properties(MonthGrid.qml PROPERTIES + QT_QML_SOURCE_VERSION "1.0" +) +set_source_files_properties(WeekNumberColumn.qml PROPERTIES + QT_QML_SOURCE_VERSION "1.0" +) + +qt6_target_qml_files(qtquickcalendarplugin + FILES + ${qml_files} +) +qt_add_docs(qtquickcalendarplugin + doc/qtquickcalendar.qdocconf +) + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000..2214137 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,7 @@ +# Generated from tests.pro. + +if(QT_BUILD_STANDALONE_TESTS) + # Add qt_find_package calls for extra dependencies that need to be found when building + # the standalone tests here. +endif() +qt_build_tests() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt new file mode 100644 index 0000000..199eecd --- /dev/null +++ b/tests/auto/CMakeLists.txt @@ -0,0 +1,3 @@ +# Generated from auto.pro. + +add_subdirectory(calendar) diff --git a/tests/auto/calendar/CMakeLists.txt b/tests/auto/calendar/CMakeLists.txt new file mode 100644 index 0000000..34937d1 --- /dev/null +++ b/tests/auto/calendar/CMakeLists.txt @@ -0,0 +1,25 @@ +# Generated from calendar.pro. + +##################################################################### +## tst_calendar Test: +##################################################################### + +# Collect test data +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/data/tst_*) +list(APPEND test_data ${test_data_glob}) + +qt_add_test(tst_calendar + GUI + QMLTEST + SOURCES + tst_calendar.cpp + PUBLIC_LIBRARIES + Qt::Gui + TESTDATA ${test_data} +) + +#### Keys ignored in scope 1:.:.:calendar.pro:<TRUE>: +# OTHER_FILES = "$$PWD/data/*.qml" +# TEMPLATE = "app" |