-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
87 lines (75 loc) · 1.97 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
cmake_minimum_required(VERSION 3.8)
project(dr_ensenso)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
add_compile_options(-Wall -Wextra -Wpedantic)
add_link_options(LINKER:--as-needed)
find_package(catkin REQUIRED COMPONENTS
estd
dr_util
)
find_package(Ensenso REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem date_time chrono)
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED)
find_package(jsoncpp REQUIRED)
find_package(fmt REQUIRED)
find_package(PCL REQUIRED)
# Remove python2 dependencies, we don't need these anyway.
list(REMOVE_ITEM PCL_LIBRARIES
"vtkGUISupportQt"
"vtkGUISupportQtOpenGL"
"vtkGUISupportQtSQL"
"vtkGUISupportQtWebkit"
"vtkViewsQt"
"vtkRenderingQt"
)
list(FILTER PCL_LIBRARIES EXCLUDE REGEX "(^|/)(libNxLib|libpython2).*[.]so$")
list(FILTER catkin_LIBRARIES EXCLUDE REGEX "(^|/)(libpython2).*[.]so$")
catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
DEPENDS PCL Ensenso Boost EIGEN3 OpenCV jsoncpp
CATKIN_DEPENDS estd
CFG_EXTRAS "compile_options.cmake"
)
include_directories(SYSTEM
${Boost_INCLUDE_DIRS}
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${Ensenso_INCLUDE_DIRS}
${jsoncpp_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
)
include_directories(include/${PROJECT_NAME})
add_library(${PROJECT_NAME}
src/eigen.cpp
src/ensenso.cpp
src/opencv.cpp
src/pcl.cpp
src/util.cpp
)
target_link_libraries(${PROJECT_NAME}
${Boost_LIBRARIES}
${catkin_LIBRARIES}
${EIGEN3_LIBRARIES}
${Ensenso_LIBRARIES}
${jsoncpp_LIBRARIES}
${OpenCV_LIBRARIES}
${PCL_LIBRARIES}
${fmt_LIBRARIES}
fmt::fmt
)
install(
TARGETS "${PROJECT_NAME}"
ARCHIVE DESTINATION "${CATKIN_PACKAGE_LIB_DESTINATION}"
LIBRARY DESTINATION "${CATKIN_PACKAGE_LIB_DESTINATION}"
RUNTIME DESTINATION "${CATKIN_PACKAGE_BIN_DESTINATION}"
)
install(
DIRECTORY "include/${PROJECT_NAME}/"
DESTINATION "${CATKIN_PACKAGE_INCLUDE_DESTINATION}"
)