-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (59 loc) · 1.8 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
cmake_minimum_required(VERSION 3.5)
project(image_undistort)
set(CMAKE_BUILD_TYPE "Release")
add_compile_options(-std=c++14)
set(CMAKE_CXX_FLAGS "-std=c++14 -O3")
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(catkin REQUIRED COMPONENTS
sensor_msgs
roscpp
rosbag
rospy
std_msgs
cv_bridge
)
find_package(Eigen3 REQUIRED)
find_package(OpenCV REQUIRED) # 4.2.0
# ----------------------------------------------------------------------------------------------------------------------------- #
# 开始打包相机模型
# ----------------------------------------------------------------------------------------------------------------------------- #
# 配置子程序
file(GLOB CAMERA_MODEL_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/camera_gpl/**.c**
${CMAKE_CURRENT_SOURCE_DIR}/src/camera_models/**.c**
)
add_library(
CAMERA_MODEL_LIB SHARED
${CAMERA_MODEL_FILES}
)
target_include_directories(
CAMERA_MODEL_LIB PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${OpenCV_INCLUDE_DIRS}
)
target_link_libraries(
CAMERA_MODEL_LIB PUBLIC
${OpenCV_LIBS}
Eigen3::Eigen
)
# ----------------------------------------------------------------------------------------------------------------------------- #
# 完成打包相机模型
# ----------------------------------------------------------------------------------------------------------------------------- #
include_directories(
${catkin_INCLUDE_DIRS}
${EIGEN3_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/include
)
catkin_package(
CATKIN_DEPENDS roscpp rosbag rospy std_msgs sensor_msgs cv_bridge
DEPENDS EIGEN3
)
add_executable(${PROJECT_NAME}_node
exe/test.cpp
)
target_link_libraries(${PROJECT_NAME}_node
${catkin_LIBRARIES}
${OpenCV_LIBS}
CAMERA_MODEL_LIB
)