~aleteoryx/muditaos

ref: sign_test muditaos/module-apps/CMakeLists.txt -rw-r--r-- 3.7 KiB
a217eeb3 — Dawid Wojtas [BH-2024] Fix lack of alarm directory after updating software 1 year, 5 months 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
# 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) 
option(ENABLE_APP_TEST "Enable test application" OFF) 

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

add_module_options( OPTION_PREFIX "APP"
                    CATALOG_PREFIX "application"
                    DEFINES_LIST_NAME "ENABLED_APPS_DEFINES"
                    IN_MODULE_NAMES ${APPLICATIONS})

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(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
        $<$<BOOL:${ENABLE_APP_CALENDAR}>:application-calendar>
        $<$<BOOL:${ENABLE_APP_MESSAGES}>:application-messages>
        $<$<BOOL:${ENABLE_APP_SETTINGS}>: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
    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>:-Wno-literal-suffix>

)

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