forked from aws/aws-iot-device-sdk-embedded-C
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (57 loc) · 2.19 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
# Set the platform named based on the host OS if not defined.
if( NOT DEFINED PLATFORM_NAME )
if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
set( PLATFORM_NAME "posix" CACHE STRING "Port to use for building the SDK." )
else()
message( FATAL_ERROR "${CMAKE_SYSTEM_NAME} is not a supported platform." )
endif()
endif()
# Include each subdirectory that has a CMakeLists.txt file in it
file(GLOB demo_dirs "${DEMOS_DIR}/*/*")
foreach(demo_dir IN LISTS demo_dirs)
if(IS_DIRECTORY "${demo_dir}" AND EXISTS "${demo_dir}/CMakeLists.txt")
add_subdirectory(${demo_dir})
endif()
endforeach()
# Filter demos based on what packages or library exist.
if(${LIB_RT} STREQUAL "LIB_RT-NOTFOUND")
set(librt_demos
"http_demo_s3_download_multithreaded"
"ota_demo_core_http"
"ota_demo_core_mqtt"
)
message( WARNING "rt library could not be found. Demos that use it will be excluded from the default target." )
foreach(demo_name ${librt_demos})
set_target_properties(${demo_name} PROPERTIES EXCLUDE_FROM_ALL true)
endforeach()
endif()
if(NOT ${OpenSSL_FOUND})
set(openssl_demos
"defender_demo"
"http_demo_basic_tls"
"http_demo_mutual_auth"
"http_demo_s3_download"
"http_demo_s3_download_multithreaded"
"http_demo_s3_upload"
"mqtt_demo_basic_tls"
"mqtt_demo_mutual_auth"
"mqtt_demo_subscription_manager"
"ota_demo_core_http"
"ota_demo_core_mqtt"
"shadow_demo_main"
)
message( WARNING "OpenSSL library could not be found. Demos that use it will be excluded from the default target." )
foreach(demo_name ${openssl_demos})
set_target_properties(${demo_name} PROPERTIES EXCLUDE_FROM_ALL true)
endforeach()
endif()
if(NOT ${Threads_FOUND})
set(thread_demos
"ota_demo_core_http"
"ota_demo_core_mqtt"
)
message( WARNING "Threads library could not be found. Demos that use it will be excluded from the default target." )
foreach(demo_name ${thread_demos})
set_target_properties(${demo_name} PROPERTIES EXCLUDE_FROM_ALL true)
endforeach()
endif()