forked from aws/aws-iot-fleetwise-edge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
59 lines (49 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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
cmake_minimum_required(VERSION 3.10.2)
project(iotfleetwise VERSION 1.0.4)
# AWS IoT FleetWise Edge uses C++14 for compatibility reasons with
# Automotive middlewares ( Adaptive AUTOSAR, ROS2)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)
message(STATUS "Hello from the AWS IoT FleetWise build system!")
# Print out the compile commands which is useful for IDEs
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# All AWS IoT FleetWise build and configure options are prefaced with an FWE_ to set
# them apart from other build options.
option(FWE_STATIC_LINK "Statically link external libs" OFF)
option(FWE_CODE_COVERAGE "Enables code coverage" OFF)
option(FWE_VALGRIND "Enable valgrind tests" OFF)
option(FWE_BUILD_DOC "Build documentation" ON)
option(FWE_STRIP_SYMBOLS "Strips symbols from output binaries" OFF)
option(FWE_FEATURE_CAMERA "Enable Camera Data Collection feature" OFF)
option(FWE_TEST_CLANG_TIDY "Add clang-tidy test" ON)
option(FWE_TEST_FAKETIME "Enable tests that use the faketime library" OFF)
option(FWE_SECURITY_COMPILE_FLAGS "Add security related compile options" OFF)
option(FWE_AWS_SDK_SHARED_LIBS "Use AWS SDK shared libs. Needs to be set to the same value of BUILD_SHARED_LIBS that the SDK was compiled with." OFF)
option(FWE_AWS_SDK_EXTRA_LIBS "Extra libs required to link with the AWS SDK. When FWE_STATIC_LINK is ON, setting this to ON will automatically find the standard libs. Can be a space-separated list of libs." ON)
option(FWE_EXAMPLE_IWAVEGPS "Include the IWave GPS example for a custom data source" OFF)
if(FWE_EXAMPLE_IWAVEGPS)
add_compile_options("-DFWE_EXAMPLE_IWAVEGPS")
endif()
# Define the default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include(cmake/graphviz.cmake)
include(cmake/compiler_gcc.cmake)
include(cmake/protobufs.cmake)
if(FWE_FEATURE_CAMERA)
add_compile_options("-DFWE_FEATURE_CAMERA")
include(cmake/ddsidls.cmake)
endif()
include(cmake/snappy.cmake)
include(CTest)
include(cmake/unit_test.cmake)
include(cmake/valgrind.cmake)
include(cmake/clang_tidy.cmake)
if(FWE_BUILD_DOC)
include(cmake/doxygen.cmake)
endif()
add_subdirectory(src)
# Disallow cycles
set_property( GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES ON )