-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCMakeLists.txt
114 lines (98 loc) · 2.31 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
cmake_minimum_required(VERSION 2.8.3)
set(CMAKE_CXX_FLAGS "-std=c++14")
project(pharao_gtsam)
# CMAKE TWEAKS
#========================================================================
if (NOT CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE RelWithDebInfo)
endif ()
# INCLUDE LOCAL MODULES
#========================================================================
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "./cmake")
file (GLOB MODULES "${CMAKE_MODULE_PATH}/*.cmake")
foreach (MODULE ${MODULES})
include (${MODULE})
endforeach ()
set (SRC
src/PhaRaO.cpp
src/factor/GraphOptimizer.cpp
src/factor/FactorConstructor.cpp
src/gtsam_custom/hs_rotation_factor.cpp
src/imgProcess/ImageTF.cpp
src/imgProcess/fftModule.cpp
)
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
nav_msgs
tf
cv_bridge
eigen_conversions
image_transport
sensor_msgs
pcl_conversions
pcl_ros
)
find_package(Boost 1.65.1 COMPONENTS timer)
find_package(OpenCV REQUIRED)
find_package(OpenMP REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)
find_package(FFTW3 REQUIRED)
# Find GTSAM components
find_package(GTSAM REQUIRED) # Uses installed package
include_directories(${GTSAM_INCLUDE_DIR})
set(GTSAM_LIBRARIES gtsam) # TODO: automatic search libs
find_package(GTSAMCMakeTools)
#include(GtsamMakeConfigFile)
#include(GtsamBuildTypes)
#include(GtsamTesting)
generate_messages(
DEPENDENCIES
std_msgs
sensor_msgs
)
catkin_package (
# INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
# CATKIN_DEPENDS roscpp std_msgs
CATKIN_DEPENDS cv_bridge eigen_conversions image_transport roscpp rospy std_msgs sensor_msgs pcl_ros pcl_conversions
DEPENDS Boost
)
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIR}
${PCL_INCLUDE_DIRS}
${Boost_INCLUDE_DIR}
)
add_library(${PROJECT_NAME}
${SRC}
)
target_link_libraries (${PROJECT_NAME}
gtsam
${catkin_LIBRARIES}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${PCL_LIBRARIES}
${Boost_LIBRARIES}
-lfftw3 -lfftw3f
-lfftw3f_threads
)
add_executable(${PROJECT_NAME}_node src/main.cpp)
target_link_libraries(${PROJECT_NAME}_node
${PROJECT_NAME}
gtsam
${catkin_LIBRARIES}
${OpenCV_LIBS}
${EIGEN3_LIBS}
${PCL_LIBRARIES}
${Boost_LIBRARIES}
-lfftw3 -lfftw3f
-lfftw3f_threads
)