-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
executable file
·76 lines (57 loc) · 2.65 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
PROJECT(RGBD360)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # Required by CMake 2.7+
endif(COMMAND cmake_policy)
# Set the same build directory for all executables
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR} CACHE PATH "Build directory" FORCE)
FIND_PACKAGE( Boost 1.46.0 REQUIRED serialization )
# Set the RGBD360_SOURCE_DIR variable to the current source directory
set(RGBD360_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#Add here your project dependencies
#FIND_PACKAGE(MRPT REQUIRED hwdrivers maps graphslam)
FIND_PACKAGE(MRPT REQUIRED base hwdrivers slam maps graphslam pbmap)
FIND_PACKAGE(PCL REQUIRED)
FIND_PACKAGE(OpenCV REQUIRED )
link_directories(${OpenCV_LIBS_DIR})
INCLUDE_DIRECTORIES(${PCL_INCLUDE_DIRS})
LINK_DIRECTORIES(${PCL_LIBRARY_DIRS})
ADD_DEFINITIONS(${PCL_DEFINITIONS})
#FIND_PACKAGE(G2O REQUIRED)
#INCLUDE_DIRECTORIES(${G2O_INCLUDE_DIR})
# OpenMP library
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}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
# Include the project 'OpenNI2_Grabber'
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenNI2_Grabber/FrameRGBD)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenNI2_Grabber/grabber)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenNI2_Grabber/third_party/OpenNI2/Include)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenNI2_Grabber/third_party/CLAMS/include)
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/OpenNI2_Grabber/third_party/cvSerialization)
# Set the path to this project' sources
ADD_DEFINITIONS(-DPROJECT_SOURCE_PATH="${PROJECT_SOURCE_DIR}")
#OpenNI2
LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
LINK_DIRECTORIES(${CMAKE_BINARY_DIR}/OpenNI2/Drivers)
# Select the "apps" to be built
SET( BUILD_CALIBRATION OFF CACHE BOOL "Build Calibration tools")
ADD_SUBDIRECTORY(Calibration)
SET( BUILD_GRABBER ON CACHE BOOL "Build Grabber tools")
ADD_SUBDIRECTORY(Grabber)
SET( BUILD_VISUALIZATION ON CACHE BOOL "Build Visualization tools")
ADD_SUBDIRECTORY(Visualization)
SET( BUILD_LABELIZATION ON CACHE BOOL "Build Labelization tools")
ADD_SUBDIRECTORY(Labelization)
SET( BUILD_REGISTRATION ON CACHE BOOL "Build Registration tools")
ADD_SUBDIRECTORY(Registration)
SET( BUILD_SLAM ON CACHE BOOL "Build SLAM Applications")
ADD_SUBDIRECTORY(SLAM)
# Set optimized building:
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mtune=native")
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")