-
Notifications
You must be signed in to change notification settings - Fork 50
/
CMakeLists.txt
120 lines (96 loc) · 3.64 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
cmake_minimum_required (VERSION 3.1)
project (lidartag)
# CMAKE TWEAKS
#========================================================================
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -O3 -DEIGEN_NO_DEBUG -march=native -Wl,--no-as-needed")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
message(STATUS "=============================================CMAKE_MODULE_PATH: ${CMAKE_MODULE_PATH}")
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
tf
sensor_msgs
visualization_msgs
message_filters
std_msgs
velodyne_pointcloud
roslib
lidartag_msgs
)
# CHECK THE DEPENDENCIES
find_package(NLopt REQUIRED)
# PCL
find_package(PCL 1.2 REQUIRED)
find_package(Boost REQUIRED
COMPONENTS filesystem system signals regex date_time program_options thread
)
# NLOPT
message(STATUS "===============================NLOPT lib: ${NLOPT_LIBRARIES}")
# TBB
find_package(TBB REQUIRED)
if(TBB_FOUND)
message(STATUS "=============================================TBB FOUND")
message(STATUS "===============================TBB include_dirs: ${TBB_INCLUDE_DIRS}")
message(STATUS "===============================TBB includes: ${TBB_INCLUDES}")
message(STATUS "===============================TBB libs: ${TBB_LIBS}")
message(STATUS "===============================TBB libraries: ${TBB_LIBRARIES}")
message(STATUS "===============================TBB libraries: ${TBB_LIBRARIES}")
message(STATUS "===============================TBB libs: ${TBB_LIBS}")
message(STATUS "===============================TBB defs: ${TBB_DEFINITIONS}")
else()
message(STATUS "=============================================TBB NOT FOUND")
endif()
# find_package(Eigen3)
# if(NOT EIGEN3_FOUND)
# # Fallback to cmake_modules
# find_package(cmake_modules REQUIRED)
# # message(STATUS "=============================================Eigen path: ${EIGEN3_INCLUDE_DIR}")
# find_package(Eigen REQUIRED)
# set(EIGEN3_INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS})
# set(EIGEN3_LIBRARIES ${EIGEN_LIBRARIES}) # Not strictly necessary as Eigen is head only
# # Possibly map additional variables to the EIGEN3_ prefix.
# else()
# # message(STATUS "=============================================Eigen path: ${EIGEN3_INCLUDE_DIR}")
# set(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
# endif()
message(STATUS "Trying to include Eigen library")
set(EIGEN3_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/internal_eigen3/eigen)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
find_package(Eigen3 3.4.0 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
message(STATUS "================================== EIGEN (internal): " ${EIGEN3_VERSION})
find_package(Qt5 COMPONENTS Core Widgets REQUIRED)
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS
message_filters
roscpp
sensor_msgs
std_msgs
tf
DEPENDS
Eigen3
)
include_directories(
include
${catkin_INCLUDE_DIRS}
${PCL_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${TBB_INCLUDE_DIRS}
)
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
# COMPILE THE SOURCE
#========================================================================
add_executable(lidartag_main src/main.cc src/lidartag_pose.cc src/lidartag.cc src/lidartag_decode.cc src/apriltag_utils.cc src/utils.cc src/tag49h14.cc src/tag16h5.cc src/lidartag_rviz.cc src/lidartag_cluster.cc src/lidartag_prune.cc)
add_dependencies(lidartag_main ${${PROJECT_NAME}_EXPORTED_TARGETS}
${catkin_EXPORTED_TARGETS})
target_link_libraries(lidartag_main
${catkin_LIBRARIES}
${Boost_LIBRARIES}
${PCL_LIBRARIES}
${NLOPT_LIBRARIES}
${TBB_LIBRARIES}
)