diff --git a/CMakeLists.txt b/CMakeLists.txt index b126643..7e56c7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ qt_add_executable(${CMAKE_PROJECT_NAME} qt_add_qml_module(${CMAKE_PROJECT_NAME} URI ${CMAKE_PROJECT_NAME} + RESOURCE_PREFIX / NO_PLUGIN QML_FILES qml/MobileApplication.qml diff --git a/thirdparty/ComponentLibrary/CMakeLists.txt b/thirdparty/ComponentLibrary/CMakeLists.txt index 9378311..d57bb00 100644 --- a/thirdparty/ComponentLibrary/CMakeLists.txt +++ b/thirdparty/ComponentLibrary/CMakeLists.txt @@ -1,11 +1,7 @@ -project(ComponentLibrary LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) +qt_add_library(ComponentLibrary STATIC) # Use that find_package() call in the root project: -find_package(Qt6 6.5 REQUIRED COMPONENTS Core Svg Qml Quick QuickControls2 LabsQmlModels) +find_package(Qt6 6.5 REQUIRED COMPONENTS Core Quick QuickControls2 LabsQmlModels) ################################################################################ @@ -177,8 +173,8 @@ list(APPEND MODULE_SOURCES ################################################################################ -set_source_files_properties(QML_FILES PROPERTIES - QT_QML_SKIP_CACHEGEN FALSE +set_source_files_properties(${MODULE_QML_FILES} ${MODULE_JS_FILES} PROPERTIES + QT_QML_SKIP_CACHEGEN TRUE ) set_source_files_properties(ThemeEngine.qml PROPERTIES @@ -186,18 +182,21 @@ set_source_files_properties(ThemeEngine.qml PROPERTIES QT_QML_SOURCE_TYPENAME Theme ) -qt_add_library(ComponentLibrary STATIC) +set_target_properties(ComponentLibrary PROPERTIES AUTOMOC ON) +set_target_properties(ComponentLibrary PROPERTIES AUTORCC ON) + +target_include_directories(ComponentLibrary PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries(ComponentLibrary PRIVATE Qt6::Core Qt6::Quick Qt6::QuickControls2 Qt6::LabsQmlModels) qt_add_qml_module(ComponentLibrary URI ComponentLibrary + VERSION 1.0 # not particularly necessary DEPENDENCIES QtCore QtQuick + RESOURCE_PREFIX / QML_FILES ${MODULE_QML_FILES} ${MODULE_JS_FILES} RESOURCES ${MODULE_ASSETS} SOURCES ${MODULE_SOURCES} ) -target_include_directories(ComponentLibrary PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) - -target_compile_definitions(ComponentLibrary PRIVATE $<$,$>:QT_QML_DEBUG>) - -target_link_libraries(ComponentLibrary PRIVATE Qt6::Core Qt6::Qml Qt6::Quick Qt6::QuickControls2 Qt6::LabsQmlModels) +################################################################################