This repository has been archived by the owner on Aug 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathCMakeLists.txt
94 lines (78 loc) · 2.9 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
cmake_minimum_required(VERSION 2.8.3)
project(fast_change_detection)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_RELEASE} -std=c++11 -DNDEBUG -O3")
set(CMAKE_BUILD_TYPE Release)
find_package(catkin REQUIRED COMPONENTS glow)
find_package(OpenCV REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(Boost REQUIRED COMPONENTS filesystem system)
set(CMAKE_INCLUDE_CURRENT_DIR ON) # needs to be activated for qt generated files in build directory.
set(CMAKE_AUTOMOC ON)
option(USE_OpenMP "Use OpenMP" OFF)
if(USE_OpenMP)
find_package(OpenMP)
if(OPENMP_FOUND)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()
endif()
catkin_package(
INCLUDE_DIRS src/
LIBRARIES fastcd
CATKIN_DEPENDS glow
)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
include_directories(${catkin_INCLUDE_DIRS})
include_directories(${QT5_INCLUDE_DIRS}
${GLEW_INCLUDE_DIRS}
${OpenCV_INCLUDE_DIRS}
/usr/include/eigen3
src)
set(FASTCD_SHADER_SRC ${CMAKE_BINARY_DIR}/fastcd_shaders.cpp)
set(VISUALIZER_SHADER_SRC ${CMAKE_BINARY_DIR}/visualizer_shaders.cpp)
compile_shaders(${FASTCD_SHADER_SRC}
src/fastcd/shaders/project_mesh.vert
src/fastcd/shaders/project_mesh.frag
)
compile_shaders(${VISUALIZER_SHADER_SRC}
src/visualizer/shaders/colored_vertices.vert
src/visualizer/shaders/colored_vertices.frag
src/visualizer/shaders/draw_mesh.vert
src/visualizer/shaders/draw_mesh.frag
src/visualizer/shaders/render_points.vert
src/visualizer/shaders/render_points.frag
)
add_library(fastcd
src/fastcd/camera.cpp
src/fastcd/image.cpp
src/fastcd/processed_image.cpp
src/fastcd/image_sequence.cpp
src/fastcd/point_covariance2d.cpp
src/fastcd/point_covariance3d.cpp
src/fastcd/depth_projector.cpp
src/fastcd/mesh.cpp
src/fastcd/regions3d_projector.cpp
src/fastcd/change_detector.cpp
src/fastcd/regions_matcher_hist.cpp
${FASTCD_SHADER_SRC}
)
target_link_libraries(fastcd ${catkin_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES})
add_executable(fastcd_example src/example.cpp
src/utils/obj_reader.cpp
src/visualizer/visualizer.cpp
${VISUALIZER_SHADER_SRC}
)
target_link_libraries(fastcd_example fastcd ${OPENGL_LIBRARIES} ${catkin_LIBRARIES} ${GLEW_LIBRARIES} Qt5::Widgets Qt5::OpenGL)
# Generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile @ONLY)
add_custom_target(doc ALL
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif(DOXYGEN_FOUND)