-
Notifications
You must be signed in to change notification settings - Fork 21
/
CMakeLists.txt
120 lines (99 loc) · 3.23 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 2.8)
project(ICP)
cmake_policy(SET CMP0025 NEW)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra")
add_definitions(-DPROFILE)
option(BUILD_ICP "Build the ICP library, requires other packages" ON)
option(BUILD_ICP_TEST "Build the ICP library test suite, requires other packages" OFF)
if(BUILD_ICP_TEST)
find_package(Calibu REQUIRED)
find_package(HAL REQUIRED)
find_package(Pangolin REQUIRED)
find_package(SceneGraph REQUIRED)
endif()
if(BUILD_ICP)
find_package(CImg REQUIRED)
endif()
#set(CMAKE_C_COMPILER clang CACHE STRING "C compiler" FORCE)
#set(CMAKE_CXX_COMPILER clang++ CACHE STRING "C++ compiler" FORCE)
find_package(PCL REQUIRED)
find_package(OpenMP QUIET)
if (OPENMP_FOUND)
message(STATUS "OpenMP found")
add_definitions(-DUSE_OPENMP)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
else()
message(STATUS "OpenMP NOT found")
endif ()
if(BUILD_ICP_TEST)
include_directories( ${Calibu_INCLUDE_DIRS} )
include_directories( ${HAL_INCLUDE_DIRS} )
include_directories( ${Pangolin_INCLUDE_DIRS} )
include_directories( ${SceneGraph_INCLUDE_DIRS} )
endif()
if (BUILD_ICP)
include_directories( ${Sophus_INCLUDE_DIRS})
include_directories( ${CImg_INCLUDE_DIRS} )
endif()
include_directories( ${PCL_INCLUDE_DIRS} )
include_directories( "src"
${CMAKE_BINARY_DIR}
${CMAKE_SOURCE_DIR}
)
link_directories( ${CMAKE_BINARY_DIR} )
link_directories( ${PCL_LIBRARY_DIRS} )
add_definitions( ${PCL_DEFINITIONS} )
add_library( dualquat SHARED src/dualquat.cpp )
add_executable( dualquat_test tests/dualquat_test.cpp )
target_link_libraries( dualquat_test dualquat )
add_library( kdtree SHARED src/kdtree.cpp )
add_executable( kdtree_test tests/kdtree_test.cpp )
target_link_libraries( kdtree_test kdtree ${PCL_LIBRARIES} )
if(BUILD_ICP)
add_library( icp SHARED src/icp.cpp )
target_link_libraries( icp dualquat ${PCL_LIBRARIES} )
if (BUILD_ICP_TEST)
add_executable( icp_test tests/icp_test.cpp )
target_link_libraries( icp_test
dualquat
icp
${PCL_LIBRARIES}
${Pangolin_LIBRARIES}
${SceneGraph_LIBRARIES}
)
add_executable( main src/main.cpp )
target_link_libraries( main icp dualquat ${PCL_LIBRARIES} )
add_executable( aggregate_pc src/aggregate_pc.cpp )
add_executable( make_pc src/make_pc.cpp )
add_executable( make_other_pc src/make_other_pc.cpp )
link_directories(${CImg_SYSTEM_LIBS_DIR})
target_link_libraries( make_other_pc ${CImg_SYSTEM_LIBS} )
add_executable( plot_pc src/plot_pc.cpp )
add_executable( edit_pc src/edit_pc.cpp )
target_link_libraries( aggregate_pc
${HAL_LIBRARIES}
${Pangolin_LIBRARIES}
${SceneGraph_LIBRARIES}
${PCL_LIBRARIES}
)
target_link_libraries( make_pc
${Calibu_LIBRARIES}
${HAL_LIBRARIES}
${Pangolin_LIBRARIES}
${SceneGraph_LIBRARIES}
${PCL_LIBRARIES}
)
target_link_libraries( plot_pc
${HAL_LIBRARIES}
${Pangolin_LIBRARIES}
${SceneGraph_LIBRARIES}
${PCL_LIBRARIES}
)
target_link_libraries( edit_pc
${PCL_LIBRARIES}
)
endif()
endif()