Skip to content

Commit

Permalink
Work on CI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
emericg committed Dec 10, 2024
1 parent cbd9768 commit d8fa932
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 13 additions & 14 deletions thirdparty/ComponentLibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)

################################################################################

Expand Down Expand Up @@ -177,27 +173,30 @@ 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
QT_QML_SINGLETON_TYPE TRUE
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 $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)

target_link_libraries(ComponentLibrary PRIVATE Qt6::Core Qt6::Qml Qt6::Quick Qt6::QuickControls2 Qt6::LabsQmlModels)
################################################################################

0 comments on commit d8fa932

Please sign in to comment.