-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
69 lines (52 loc) · 1.77 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
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 2.8.3)
cmake_policy(SET CMP0048 NEW) # avoids CMAKE_PROJECT_VERSION warning
project(x_evaluate)
set (CMAKE_BUILD_TYPE Release)
if (CMAKE_BUILD_TYPE MATCHES Release)
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
# build with catkin build x_evaluate --cmake-args -DMY_DEBUG=1
if (MY_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Og")
endif()
# for debugging memory leaks
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Og -fno-omit-frame-pointer -fsanitize=address") # REMOVE ME LATER
#set(CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -g -Og -fno-omit-frame-pointer -fsanitize=address") # REMOVE ME LATER
find_package(catkin REQUIRED COMPONENTS
x
cv_bridge
rosbag
dvs_msgs
sensor_msgs
std_msgs
gflags_catkin
glog_catkin
easy_profiler_catkin
)
find_package(yaml-cpp REQUIRED) # used in evaluation executable
catkin_python_setup()
catkin_package()
# Set build flags, depending on the architecture
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -Wall")
include_directories (
${OpenCV_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${easy_profiler_catkin_INCLUDE_DIRS}
${glog_catkin_INCLUDE_DIRS}
)
set (FS_LIBRARY "")
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1)
set(FS_LIBRARY stdc++fs)
endif()
# add generic evaluation program as executable to be a able to call it from python
add_executable(evaluate ${SOURCE} test/evaluate.cpp)
target_link_libraries(evaluate
${OpenCV_LIBRARIES}
${catkin_LIBRARIES}
${rostest_LIBRARIES}
${YAML_CPP_LIBRARIES}
${easy_profiler_catkin_LIBRARIES}
${FS_LIBRARY}
)
target_compile_definitions(evaluate PUBLIC -DUSING_EASY_PROFILER)
catkin_install_python(PROGRAMS test/evaluate.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})