-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
36 lines (30 loc) · 1.32 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
cmake_minimum_required(VERSION 3.2.1)
project (robot_controller)
# Add project cmake modules to path.
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
find_package(Boost 1.54.0 REQUIRED COMPONENTS filesystem system iostreams)
if(Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
else()
message(FATAL_ERROR "This project requires boost. Please install from http://www.boost.org")
endif()
# We probably don't want this to run on every build.
option(COVERAGE "Generate Coverage Data" OFF)
if (COVERAGE)
include(CodeCoverage)
set(LCOV_REMOVE_EXTRA "'vendor/*'")
set(LCOV_REMOVE_EXTRA "'lib/*'")
setup_target_for_coverage(code_coverage test/cpp-test coverage)
set(COVERAGE_SRCS app/ackermann.cpp app/pid.cpp app/twoWDRobot.cpp app/visualization.cpp include/ackermann.hpp include/pid.hpp include/twoWDRobot.hpp include/visualization.hpp)
SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage")
SET(CMAKE_EXE_LINKER_FLAGS "-fprofile-arcs -ftest-coverage")
else()
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -g")
endif()
include(CMakeToolsHelpers OPTIONAL)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_STANDARD 14)
add_subdirectory(app)
add_subdirectory(test)
add_subdirectory(vendor/googletest/googletest)