-
Notifications
You must be signed in to change notification settings - Fork 13
/
CMakeLists.txt
140 lines (119 loc) · 5.1 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
project(symseg)
set (CMAKE_BUILD_TYPE Release)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/../bin")
add_definitions("-Wall -pedantic")
### ----------------------------------------------------------------------------
### PCL
### ----------------------------------------------------------------------------
find_package(PCL 1.8.0 REQUIRED)
message (STATUS "")
if (PCL_FOUND)
message (STATUS " -----------------------")
message (STATUS " Found PCL version ${PCL_VERSION}")
message (STATUS " * include dirs: ${PCL_INCLUDE_DIRS}")
message (STATUS " * library dirs: ${PCL_LIBRARY_DIRS}")
message (STATUS " * libraries: ${PCL_LIBRARIES}")
else()
message (FATAL_ERROR : "PCL NOT FOUND!")
endif()
include_directories(${PCL_INCLUDE_DIRS})
link_directories(${PCL_LIBRARY_DIRS})
add_definitions(${PCL_DEFINITIONS})
### ----------------------------------------------------------------------------
### Boost
### ----------------------------------------------------------------------------
find_package(Boost REQUIRED COMPONENTS regex)
message (STATUS "")
if(Boost_FOUND)
message (STATUS " --------------------------")
message (STATUS " Found Boost version ${Boost_VERSION}")
message (STATUS " * include dirs: ${Boost_INCLUDE_DIRS}")
message (STATUS " * libraries: ${Boost_LIBRARIES}")
else()
message (FATAL_ERROR : "Boost NOT FOUND!")
endif()
### ----------------------------------------------------------------------------
### OpenMP
### ----------------------------------------------------------------------------
find_package(OpenMP REQUIRED)
message (STATUS "")
if (OPENMP_FOUND)
message (STATUS " ------------")
message (STATUS " Found OpenMP")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
else()
message (FATAL_ERROR : "OpenMP NOT FOUND!")
endif()
### ----------------------------------------------------------------------------
### OctoMap
### ----------------------------------------------------------------------------
find_package(octomap 1.8.0 REQUIRED)
message (STATUS "")
if (octomap_FOUND)
message (STATUS " ---------------------------")
message (STATUS " Found OctoMap version ${octomap_VERSION}")
message (STATUS " * include dirs: ${OCTOMAP_INCLUDE_DIRS}")
message (STATUS " * libraries: ${OCTOMAP_LIBRARIES}")
else()
message (FATAL_ERROR : "OctoMap NOT FOUND!")
endif()
include_directories(${OCTOMAP_INCLUDE_DIRS})
link_libraries(${OCTOMAP_LIBRARIES})
### ----------------------------------------------------------------------------
### EDT3D
### ----------------------------------------------------------------------------
find_package(dynamicEDT3D REQUIRED)
message (STATUS "")
if (dynamicEDT3D_FOUND)
message (STATUS " ---------------------------")
message (STATUS " Found dynamicEDT3D version ${dynamicedt3d_VERSION}")
message (STATUS " * include dirs: ${DYNAMICEDT3D_INCLUDE_DIRS}")
message (STATUS " * libraries: ${DYNAMICEDT3D_LIBRARIES}")
else()
message (FATAL_ERROR : "dynamicEDT3D NOT FOUND!")
endif()
include_directories(${DYNAMICEDT3D_INCLUDE_DIRS})
link_libraries(${DYNAMICEDT3D_LIBRARIES})
### ----------------------------------------------------------------------------
### Protobuffer
### ----------------------------------------------------------------------------
include(FindProtobuf)
find_package(Protobuf REQUIRED)
message (STATUS "")
if (PROTOBUF_FOUND)
message (STATUS " ---------------------------")
message (STATUS " Found Protobuf")
message (STATUS " * include dirs: ${PROTOBUF_INCLUDE_DIRS}")
message (STATUS " * libraries: ${PROTOBUF_LIBRARIES}")
else()
message (FATAL_ERROR : "Protobuf NOT FOUND!")
endif()
add_subdirectory(proto) # Generate headers and libraries for proto files.
### ----------------------------------------------------------------------------
### Project dependencies
### ----------------------------------------------------------------------------
set (includes ./utilities
./occupancy_map
./segmentation
./symmetry_segmentation
${CMAKE_BINARY_DIR}/proto) # This is required to make sure header files above can find header files generated for protos.
include_directories (${includes})
### ----------------------------------------------------------------------------
### C++11 support
### ----------------------------------------------------------------------------
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()
### ----------------------------------------------------------------------------
### Examples
### ----------------------------------------------------------------------------
add_subdirectory(examples)