forked from GENIVI/CANdb
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
43 lines (32 loc) · 1.15 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
cmake_minimum_required(VERSION 3.8.0)
project(CANdb CXX C)
option(CANDB__WITH_COVERAGE "Build with coverage" OFF)
option(CANDB__WITH_TESTS "Build with test" ON)
option(CANDB__WITH_TOOLS "Build example dbc tools" ON)
option(CANDB__TRAVIS_BUILD "Build via travis" OFF)
set(CMAKE_CXX_STANDARD 14)
find_package(Threads REQUIRED)
find_package(Boost REQUIRED)
add_definitions(-DFMT_HEADER_ONLY) # for spdlog/libfmt
if (NOT CANDB__TRAVIS_BUILD)
find_package(spdlog 1.4.2 REQUIRED)
set(LIBSPDLOG spdlog::spdlog)
else (NOT CANDB__TRAVIS_BUILD)
# only to allow building with travis... for now
set(LIBSPDLOG spdlog)
endif (NOT CANDB__TRAVIS_BUILD)
add_subdirectory(3rdParty)
if(CANDB__WITH_COVERAGE)
set(CMAKE_CXX_FLAGS "-g -O0 -Wwrite-strings -fprofile-arcs -ftest-coverage")
set(CMAKE_C_FLAGS="-g -O0 -Wall -W -fprofile-arcs -ftest-coverage")
set(CMAKE_EXE_LINKER_FLAGS="-fprofile-arcs -ftest-coverage")
endif()
add_subdirectory(src)
if((CANDB__WITH_TESTS OR CANDB__WITH_COVERAGE))
enable_testing()
add_subdirectory(tests)
endif()
if(CANDB__WITH_TOOLS)
add_subdirectory(tools)
endif(CANDB__WITH_TOOLS)
install(FILES CANdbConfig.cmake DESTINATION .)