-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
54 lines (44 loc) · 1.74 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON)
# Note: If project name is changed, also the task.json and launch.json for vscode needs to be updated
project(app)
set(${PROJECT_NAME}_VERSION_MAJOR 0)
set(${PROJECT_NAME}_VERSION_MINOR 1)
# some options for the build
option(INSTALL_DEPENDENCIES "Only install dependencies" OFF)
option(BUILD_TEST "Build the unit tests" OFF)
option(BUILD_SIM "Build simulation (Carla client)" OFF)
option(BUILD_ARM "Build for ARM architecture" OFF)
option(BUILD_TOOLS "Build all apps in the tools folder" ON)
option(USE_ECAL "Use ecal as commuincation layer" OFF)
# export BUILD_SIM to c++ code as compiler definition
if (BUILD_SIM)
add_compile_definitions(BUILD_SIM)
endif()
if (USE_ECAL)
add_compile_definitions(USE_ECAL)
endif()
# in case we want to choose our own prefixes
set(CMAKE_STATIC_LIBRARY_PREFIX "")
set(ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
set(SRC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src")
set(INSTALL_BIN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dist/bin/${CMAKE_BUILD_TYPE}")
set(INSTALL_LIB_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dist/lib/${CMAKE_BUILD_TYPE}")
set(INSTALL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/dist/include")
set(EXTERNAL_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/install")
set(EXTERNAL_PRE_INSTALL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/pre_install")
include_directories(${SRC_DIR} NO_DEFAULT_PATH)
include(externals/dependencies.cmake)
if (NOT INSTALL_DEPENDENCIES)
add_subdirectory(src/interface) # has to be pulled as submodule
add_subdirectory(src/util)
add_subdirectory(src/algo)
add_subdirectory(src/data)
add_subdirectory(src/frame)
if(BUILD_TEST)
add_subdirectory(test)
endif()
if(BUILD_TOOLS)
add_subdirectory(src/tools)
endif()
endif()