~aleteoryx/muditaos

ref: 483ac3919a11afe2dde775c78d8743a744111611 muditaos/module-apps/CMakeLists.txt -rw-r--r-- 4.0 KiB
483ac391 — Pawel Olejniczak [CP-828] Remove outdated calendar test scripts 4 years ago
                                                                                
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md

project(module-apps VERSION 1.0
        DESCRIPTION "Library with all applications.")

module_is_test_entity()

add_library(${PROJECT_NAME} STATIC)

add_subdirectory(apps-common)

option(ENABLE_APP_ANTENNA "Enable application antenna" OFF)

set(APPLICATIONS
    alarm-clock
    antenna
    calculator
    calendar
    call
    desktop
    meditation
    messages
    music-player
    notes
    onboarding
    phonebook
    calllog
    special-input
    settings
)

list(SORT APPLICATIONS)
foreach(app IN LISTS APPLICATIONS)
    string(TOUPPER ${app} app_upper)
    string(REPLACE "-" "_" app_macro_name ${app_upper})
    if (NOT DEFINED ENABLE_APP_${app_macro_name})
        option(ENABLE_APP_${app_macro_name} "Enable application ${app}" ON)
    endif()

    if(ENABLE_APP_${app_macro_name})
        message("Enabling application: ${app}")
        add_subdirectory(application-${app})
        list(APPEND ENABLED_APPS_DEFINES "ENABLE_APP_${app_macro_name}")
    endif()
endforeach()

target_compile_definitions(application-desktop PRIVATE "${ENABLED_APPS_DEFINES}")
set(ENABLED_APPS_DEFINES ${ENABLED_APPS_DEFINES} PARENT_SCOPE)

if(${PROJECT_TARGET} STREQUAL "TARGET_Linux")
    set(OPTIMIZE_APPS_DEBUG_DEFAULT OFF)
else()
    set(OPTIMIZE_APPS_DEBUG_DEFAULT ON)
endif()
if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
    foreach(app IN LISTS APPLICATIONS)
        string(TOUPPER ${app} app_upper)
        string(REPLACE "-" "_" app_macro_name ${app_upper})
        option(OPTIMIZE_APP_${app_macro_name} "Optimize application in debug" ${OPTIMIZE_APPS_DEBUG_DEFAULT})
        if (${OPTIMIZE_APP_${app_macro_name}} AND ${ENABLE_APP_${app_macro_name}})
            get_target_property(APP_SOURCES ${PROJECT_NAME} SOURCES)
            list(FILTER APP_SOURCES INCLUDE REGEX "/application-${app}/")
            set_source_files_properties(${APP_SOURCES} PROPERTIES COMPILE_FLAGS "-Os")
        endif ()
    endforeach()
endif()

option(ENABLE_VOLTE "Enable VoLTE" OFF)
if(${ENABLE_VOLTE})
    target_compile_definitions(${PROJECT_NAME} PUBLIC ENABLE_VOLTE=1)
endif()

option(DISABLED_SETTINGS_OPTIONS "Enable Disabled Settings Options" OFF)
if(${DISABLED_SETTINGS_OPTIONS})
    target_compile_definitions(${PROJECT_NAME} PUBLIC DISABLED_SETTINGS_OPTIONS=1)
endif()

option(DEVELOPER_SETTINGS_OPTIONS "Enable Developer Settings Options" ${DEVELOPER_SETTINGS_OPTIONS_DEFAULT})
if(${DEVELOPER_SETTINGS_OPTIONS})
    target_compile_definitions(${PROJECT_NAME} PUBLIC DEVELOPER_SETTINGS_OPTIONS=1)
endif()

target_link_libraries(${PROJECT_NAME}
    PRIVATE
        app
        application-calendar
        application-messages
        application-settings
        apps-common
        date::date
        eventstore
        i18n
        libphonenumber::libphonenumber
        Microsoft.GSL::GSL
        service-antenna
        service-appmgr
        service-audio
        service-cellular
        service-db
        service-evtmgr
        service-time-api
        utils-time
        utils-bootconfig
    PUBLIC
        module-audio
        module-bsp
        module-db
        module-gui
        module-os
        module-services
        module-sys
        module-utils
        utf8
        ${TARGET_LIBRARIES}
)

# Board specific compilation definitions,options,include directories and features
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_CONFIG_DEFINITIONS})
target_compile_definitions(${PROJECT_NAME} PUBLIC ${PROJECT_TARGET})
target_include_directories(${PROJECT_NAME} PUBLIC ${PROJECT_INCLUDES})

target_include_directories(${PROJECT_NAME}
        PUBLIC

        ${CMAKE_CURRENT_SOURCE_DIR}
        ${CMAKE_BINARY_DIR}
)

target_compile_options(${PROJECT_NAME}

        PUBLIC

        -Wall

        $<$<COMPILE_LANGUAGE:C>:-std=gnu11>
        $<$<COMPILE_LANGUAGE:C>:-Wno-discarded-qualifiers>

        $<$<COMPILE_LANGUAGE:CXX>:-fno-non-call-exceptions>
        $<$<COMPILE_LANGUAGE:CXX>:-Wno-literal-suffix>

)

if (${ENABLE_TESTS})
    add_subdirectory(tests)
endif()