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 Nov 29, 2024
1 parent b3bbca2 commit 74dbf95
Show file tree
Hide file tree
Showing 17 changed files with 67 additions and 37 deletions.
15 changes: 11 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ message(STATUS "[PROJECT] QT_HOST_PATH = ${QT_HOST_PATH}")

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

find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Qml Quick QuickControls2)
find_package(Qt6 REQUIRED COMPONENTS Core Gui Svg Qml Quick QuickControls2 LabsQmlModels)
find_package(Qt6 REQUIRED COMPONENTS LinguistTools)

qt_standard_project_setup(REQUIRES 6.7)
Expand All @@ -42,6 +42,8 @@ qt_add_executable(${CMAKE_PROJECT_NAME}
src/SettingsManager.cpp src/SettingsManager.h
assets/assets.qrc
thirdparty/IconLibrary/IconLibrary.qrc
${app_icon_macos}
${app_icon_windows}
)

qt_add_qml_module(${CMAKE_PROJECT_NAME}
Expand Down Expand Up @@ -154,6 +156,9 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
#set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0")

set(app_icon_macos "${CMAKE_SOURCE_DIR}/assets/macos/${CMAKE_PROJECT_NAME}.icns")
set_source_files_properties(${app_icon_macos} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE ON
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/assets/macos/Info.plist"
Expand All @@ -168,9 +173,8 @@ endif()

## iOS
if(CMAKE_SYSTEM_NAME STREQUAL "iOS")
#set(assets_catalog_path "${CMAKE_SOURCE_DIR}/assets/ios/Assets.xcassets")
#target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${assets_catalog_path})
#set_source_files_properties(${assets_catalog_path} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
#set(app_icon_ios "${CMAKE_SOURCE_DIR}/assets/ios/Assets.xcassets")
#set_source_files_properties(${app_icon_ios} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")

set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE ON
Expand All @@ -191,6 +195,9 @@ endif()

## Windows
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")

set(app_icon_windows "${CMAKE_SOURCE_DIR}/assets/windows/${CMAKE_PROJECT_NAME}.rc")

set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES
WIN32_EXECUTABLE ON
)
Expand Down
32 changes: 32 additions & 0 deletions assets/windows/QmlAppTemplate.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "winver.h"

IDI_ICON1 ICON "QmlAppTemplate.ico"

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGS 0x0L
FILEFLAGSMASK 0x3fL
FILEOS 0x00040004L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "000004b0"
BEGIN
VALUE "CompanyName", "QmlAppTemplate"
VALUE "FileDescription", "QmlAppTemplate"
VALUE "FileVersion", "1.0.0.0"
VALUE "LegalCopyright", "Copyright (C) 2024 QmlAppTemplate"
VALUE "InternalName", "QmlAppTemplate"
VALUE "OriginalFilename", "QmlAppTemplate.exe"
VALUE "ProductName", "QmlAppTemplate"
VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0, 1200
END
END
1 change: 0 additions & 1 deletion qml/PageButtons.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Item {

Expand Down
1 change: 0 additions & 1 deletion qml/PageColors.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageDateTime.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageDialogs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageIndicators.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageSelectors.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageTextFields.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
1 change: 0 additions & 1 deletion qml/PageTickers.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Flickable {
contentWidth: -1
Expand Down
5 changes: 0 additions & 5 deletions qml/QmlImports.qml

This file was deleted.

1 change: 0 additions & 1 deletion qml/ScreenDesktopComponents.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Loader {
id: screenDesktopComponents
Expand Down
1 change: 0 additions & 1 deletion qml/ScreenMobileComponents.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import QtQuick
import QtQuick.Controls

import ComponentLibrary
import QmlAppTemplate

Loader {
id: screenMobileComponents
Expand Down
6 changes: 3 additions & 3 deletions thirdparty/AppUtils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ project(AppUtils LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)

# Use that find_package() call in the root project:
find_package(Qt6 6.6 REQUIRED COMPONENTS Core Gui Qml Quick)

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

# Optional stuff (for macOS)
Expand All @@ -15,8 +18,6 @@ set(CMAKE_AUTOMOC ON)
################################################################################

# Generic dependencies
find_package(Qt6 6.6 REQUIRED COMPONENTS Core Gui Qml Quick)

set(CORE_LIBRARIES
Qt::Core
Qt::Gui
Expand Down Expand Up @@ -115,7 +116,6 @@ endif()
################################################################################

add_library(AppUtils OBJECT ${CORE_SOURCES} ${PLATFORM_SOURCES})
add_library(AppUtils::AppUtils ALIAS AppUtils)

target_compile_definitions(AppUtils PUBLIC APP_NAME=\"${APP_NAME}\" APP_VERSION=\"${APP_VERSION}\")
target_link_libraries(AppUtils PRIVATE ${CORE_LIBRARIES} ${PLATFORM_LIBRARIES})
Expand Down
26 changes: 18 additions & 8 deletions thirdparty/ComponentLibrary/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
qt_add_library(ComponentLibrary STATIC)
project(ComponentLibrary LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

# Use that find_package() call in the root project:
find_package(Qt6 6.5 REQUIRED COMPONENTS Svg Qml Quick QuickControls2 LabsQmlModels)

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

list(APPEND MODULE_ASSETS
#
Expand Down Expand Up @@ -133,7 +142,7 @@ list(APPEND MODULE_QML_FILES
utils/WindowGeometrySaver.qml
)

if (TARGET Qt::Location)
if(TARGET Qt::Location)
list(APPEND MODULE_QML_FILES
maps/MapButton.qml
maps/MapButtonCompass.qml
Expand All @@ -143,7 +152,7 @@ if (TARGET Qt::Location)
maps/MapScale.qml
)
else()
message(STATUS "Skipping the mapping components from ComponentLibrary as Qt6::Location is not used.")
message(STATUS "ComponentLibrary > Skipping the mapping components as Qt6::Location is not used by the root project.")
endif()

list(APPEND MODULE_QML_FILES
Expand All @@ -166,6 +175,8 @@ list(APPEND MODULE_SOURCES
#
)

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

set_source_files_properties(QML_FILES PROPERTIES
QT_QML_SKIP_CACHEGEN FALSE
)
Expand All @@ -175,11 +186,7 @@ set_source_files_properties(ThemeEngine.qml PROPERTIES
QT_QML_SOURCE_TYPENAME Theme
)

set_target_properties(ComponentLibrary PROPERTIES AUTOMOC ON)

find_package(Qt6 REQUIRED COMPONENTS Qml Quick QuickControls2)

target_link_libraries(ComponentLibrary PRIVATE Qt6::Qml Qt6::Quick Qt6::QuickControls2 Qt6::QmlModels)
qt_add_library(ComponentLibrary STATIC ${MODULE_SOURCES})

qt_add_qml_module(ComponentLibrary
URI ComponentLibrary
Expand All @@ -189,3 +196,6 @@ qt_add_qml_module(ComponentLibrary
RESOURCES ${MODULE_ASSETS}
SOURCES ${MODULE_SOURCES}
)

target_link_libraries(ComponentLibrary PRIVATE Qt6::Qml Qt6::Quick Qt6::QuickControls2 Qt6::LabsQmlModels)
target_include_directories(ComponentLibrary PUBLIC ${CMAKE_CURRENT_LIST_DIR})
7 changes: 3 additions & 4 deletions thirdparty/MobileUI/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ project(MobileUI LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)

# Use that find_package() call in the root project:
find_package(Qt6 6.7 REQUIRED COMPONENTS Core Gui Qml)

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

# Generic dependencies
set(CORE_COMPONENTS Core Gui Qml)
find_package(Qt6 6.7 REQUIRED COMPONENTS ${CORE_COMPONENTS})

set(CORE_LIBRARIES Qt::Core Qt::Gui Qt::Qml)

# Generic sources
Expand All @@ -29,7 +29,6 @@ endif()
################################################################################

add_library(MobileUI OBJECT ${CORE_SOURCES} ${PLATFORM_SOURCES})
add_library(MobileUI::MobileUI ALIAS MobileUI)

target_link_libraries(MobileUI PRIVATE ${CORE_LIBRARIES} ${PLATFORM_LIBRARIES})
target_include_directories(MobileUI PUBLIC ${CMAKE_CURRENT_LIST_DIR})
3 changes: 0 additions & 3 deletions thirdparty/SingleApplication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ endif()
################################################################################

add_library(SingleApplication STATIC SingleApplication.cpp SingleApplication_private.cpp)
add_library(SingleApplication::SingleApplication ALIAS SingleApplication)

target_link_libraries(SingleApplication PRIVATE ${CORE_LIBRARIES} ${PLATFORM_LIBRARIES})
target_include_directories(SingleApplication PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
Expand All @@ -59,5 +58,3 @@ target_compile_definitions(SingleApplication PRIVATE
QT_NO_KEYWORDS
QT_NO_FOREACH
)

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

0 comments on commit 74dbf95

Please sign in to comment.