Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
68 lines (68 loc) · 2.98 KB
/
Copy pathCMakeLists.txt
File metadata and controls
68 lines (68 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.25)
file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" KOS_APP_RELEASE_VERSION LIMIT_COUNT 1)
project(KosApps VERSION ${KOS_APP_RELEASE_VERSION} LANGUAGES CXX)
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
option(BUILD_TESTING "Build application-local tests" OFF)
option(KOS_FLATPAK_BUILD "Use sandbox storage and activation" OFF)
set(KOS_APPS "calendar;calculator;weather" CACHE STRING "Applications to build (semicolon-separated)")
if(NOT KOS_APPS)
message(FATAL_ERROR "Select at least one application with KOS_APPS")
endif()
list(REMOVE_DUPLICATES KOS_APPS)
foreach(app IN LISTS KOS_APPS)
if(NOT app MATCHES "^(calendar|calculator|weather)$")
message(FATAL_ERROR "Unknown application: ${app}")
endif()
endforeach()
list(LENGTH KOS_APPS app_count)
if(KOS_FLATPAK_BUILD AND NOT app_count EQUAL 1)
message(FATAL_ERROR "A Flatpak must select exactly one KOS_APPS application")
endif()
set(KOS_FLATPAK_RELEASE_DATE "2026-11-04" CACHE STRING "AppStream release date (YYYY-MM-DD)")
if(NOT KOS_FLATPAK_RELEASE_DATE MATCHES "^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$")
message(FATAL_ERROR "KOS_FLATPAK_RELEASE_DATE must use YYYY-MM-DD")
endif()
include(CTest)
include(GNUInstallDirs)
find_package(Qt6 6.8 REQUIRED COMPONENTS Core DBus Gui Network Qml Quick QuickControls2 LinguistTools)
find_package(KF6WindowSystem 6.0 QUIET)
if(BUILD_TESTING)
find_package(Qt6 REQUIRED COMPONENTS Test)
endif()
qt_standard_project_setup(REQUIRES 6.8)
qt_policy(SET QTP0001 NEW)
qt_policy(SET QTP0004 NEW)
set(QT_QML_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/qml")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(KosApplication)
add_subdirectory(shared/qml)
add_subdirectory(shared/common)
if("calendar" IN_LIST KOS_APPS OR "weather" IN_LIST KOS_APPS)
add_subdirectory(shared/demo-ui)
endif()
if("calendar" IN_LIST KOS_APPS)
find_package(KF6CalendarCore 6.0 REQUIRED)
set(KOS_PIM_BUS_NAME "org.nextks.calendar.Pim")
add_subdirectory(shared/pim)
add_subdirectory(services/pim-service)
endif()
foreach(app IN LISTS KOS_APPS)
if(app STREQUAL "weather")
add_subdirectory(apps/org.nextks.weather/backend)
endif()
add_subdirectory(apps/org.nextks.${app})
endforeach()
install(FILES LICENSE SOURCE_PROVENANCE.md SOURCE_PROVENANCE.kos-calendar.md SOURCE_PROVENANCE.kos-calculator.md
SOURCE_PROVENANCE.kos-weather.md THIRD_PARTY_NOTICES.weather.md
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/kos-apps)
install(FILES shared/qml/controls/shaders/NOTICE.md
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/kos-apps RENAME SHADER_NOTICE.md)
if("calendar" IN_LIST KOS_APPS OR "weather" IN_LIST KOS_APPS)
install(FILES shared/demo-ui/README.md
DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/doc/kos-apps RENAME DEMO_UI_NOTICE.md)
endif()