-
Notifications
You must be signed in to change notification settings - Fork 97
/
CMakeLists.txt
65 lines (48 loc) · 2.25 KB
/
CMakeLists.txt
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
if(DEFINED WEST_PYTHON)
message(STATUS "Zephyr build detected. Using CMakeLists.txt from pal-platform/SDK/ZephyrOS instead.")
include(${CMAKE_CURRENT_SOURCE_DIR}/pal-platform/SDK/ZephyrOS/CMakeLists.txt)
return()
endif()
INCLUDE(CMakeForceCompiler)
# CROSS COMPILER SETTING
cmake_minimum_required (VERSION 3.5)
SET(CMAKE_SYSTEM_NAME Generic)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(mbedCloudClientExample)
add_definitions(-DNS_EXCLUDE_HIGHRES_TIMER)
add_definitions(-DNS_EVENTLOOP_USE_TICK_TIMER)
add_definitions(-DMBED_CONF_MBED_CLIENT_EVENT_LOOP_SIZE=8192)
# mbed-cloud-client-example
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/platform)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/include)
FILE(GLOB MBED_CLOUD_CLIENT_EXAMPLE_SRC
"${CMAKE_CURRENT_SOURCE_DIR}/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/*.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.c"
"${CMAKE_CURRENT_SOURCE_DIR}/source/*.cpp"
if(PARSEC_TPM_SE_SUPPORT)
"${CMAKE_CURRENT_SOURCE_DIR}/source/platform/secure_element/mcc_se_init.c"
endif()
)
if(PARSEC_TPM_SE_SUPPORT)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/source/platform/secure_element/se_configs)
endif()
if(ENABLE_DEVICE_SENTRY)
# MCCE device sentry example enabled, so add appropriate include files directory
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/mbed-cloud-client/device-sentry-client/source/include)
endif()
# Contain developer credential information
set(MBED_CLIENT_COMMON_CONFIG_SOURCE
"${CMAKE_CURRENT_SOURCE_DIR}/update_default_resources.c"
"${CMAKE_CURRENT_SOURCE_DIR}/mbed_cloud_dev_credentials.c"
)
add_subdirectory(source/platform ${CMAKE_CURRENT_BINARY_DIR}/source/platform)
add_subdirectory(mbed-cloud-client ${CMAKE_CURRENT_BINARY_DIR}/mbed-cloud-client)
add_library(mbedClientSharedObjects STATIC ${MBED_CLIENT_COMMON_CONFIG_SOURCE})
# Needed to link sources if there is cross-dependencies between application<->library.
set (SRC_LIBS ${SRC_LIBS} PARENT_SCOPE)
CREATE_TEST_LIBRARY(mbedCloudClientExample "${MBED_CLOUD_CLIENT_EXAMPLE_SRC}" "")
target_link_libraries(mbedCloudClientExample mbedCloudClient platformCommon mbedClientSharedObjects)