forked from mmOnsemi/strata-host-core
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
113 lines (88 loc) · 3.79 KB
/
CMakeLists.txt
File metadata and controls
113 lines (88 loc) · 3.79 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
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
##
## Copyright (c) 2018-2021 onsemi.
##
## All rights reserved. This software and/or documentation is licensed by onsemi under
## limited terms and conditions. The terms and conditions pertaining to the software and/or
## documentation are available at http://www.onsemi.com/site/pdf/ONSEMI_T&C.pdf (“onsemi Standard
## Terms and Conditions of Sale, Section 8 Software”).
##
cmake_minimum_required(VERSION 3.19 FATAL_ERROR)
message(STATUS "CMake version: ${CMAKE_VERSION}")
if(APPLE AND NOT CMAKE_OSX_DEPLOYMENT_TARGET)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "" FORCE)
endif()
project(host
DESCRIPTION "Strata"
HOMEPAGE_URL "https://www.onsemi.com/strata"
LANGUAGES CXX
)
set(VERSION_QT5 5.12)
set(VERSION_QT5_DEPRECATE_BEFORE 0x050C00)
# defaults; override in sub-projects if necessary
set(PROJECT_COMPANY "onsemi")
set(PROJECT_WIN32_ICO ${PROJECT_SOURCE_DIR}/resources/icons/app/on.ico)
set(PROJECT_BUNDLE_ID com.onsemi.strata)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(Git)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/strata-cmake-modules/Modules")
include(SetupConfigurations)
include(FeatureSummary)
include(CMakeDependentOption)
include(SetupCompileOptions)
include(GitVersionMacro)
include(TimestampMacro)
include(ReplicatorCredentialsMacro)
include(AddQmlImportPathMacro)
include(DeployConfigFilesHelpers)
# common for 'apps' and 'components' that use resource files
add_qml_import_path(PATH ":/")
if(CMAKE_BUILD_TYPE STREQUAL "OTA")
add_custom_target(${PROJECT_NAME})
generate_ifw_version(GITTAG_PREFIX "ifw_")
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_BUILD_RPATH "${CMAKE_BINARY_DIR}/bin")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_PLUGINS_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/plugins")
file(MAKE_DIRECTORY "${CMAKE_PLUGINS_OUTPUT_DIRECTORY}")
option(BUILD_TESTING "Build the testing tree" ON)
add_feature_info(BUILD_TESTING BUILD_TESTING "Build the testing tree.")
enable_testing()
option(BUILD_EXAMPLES "Build project examples" OFF)
add_feature_info(BUILD_EXAMPLES BUILD_EXAMPLES "Build project examples")
option(BUILD_BENCHMARK "Build project benchmark" OFF)
add_feature_info(BUILD_BENCHMARK BUILD_BENCHMARK "Build project benchmark")
option(APPS_UTILS "Build project supplementary utils" ON)
add_feature_info(APPS_UTILS APPS_UTILS "Build project supplementary utils")
if(NOT STRATA_HOST_CORE_INTERNAL_PATH)
set(STRATA_HOST_CORE_INTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../strata-host-core-internal")
endif()
if(IS_DIRECTORY "${STRATA_HOST_CORE_INTERNAL_PATH}")
add_subdirectory("${STRATA_HOST_CORE_INTERNAL_PATH}" "${CMAKE_BINARY_DIR}/strata-host-core-internal")
endif()
if(NOT STRATA_PLATFORM_CONTROL_VIEWS)
set(STRATA_PLATFORM_CONTROL_VIEWS "${CMAKE_CURRENT_SOURCE_DIR}/../strata-platform-control-views")
endif()
if(IS_DIRECTORY "${STRATA_PLATFORM_CONTROL_VIEWS}")
add_subdirectory("${STRATA_PLATFORM_CONTROL_VIEWS}" "${CMAKE_BINARY_DIR}/strata-platform-control-views")
endif()
# Note: please be careful with following subdirectory order; there are dependencies!
add_subdirectory(extern)
add_subdirectory(apps)
add_subdirectory(libs)
add_subdirectory(utils)
add_subdirectory(components)
message(STATUS "=============================================================================")
message(STATUS "QML import paths:")
foreach(QML_PATH IN LISTS QML_IMPORT_PATH)
message(STATUS "\t${QML_PATH}")
endforeach()
message(STATUS "Project generator: ${CMAKE_GENERATOR}")
if(CMAKE_EXTRA_GENERATOR)
message(STATUS "Project extra generator: ${CMAKE_EXTRA_GENERATOR}")
endif()
message(STATUS "=============================================================================")
feature_summary(WHAT ALL)