-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
69 lines (60 loc) · 2.38 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
#-----------------------------------------------------------------------------------------------
# CMake file for the MRPT example: /gravity3d
#
# Run with "ccmake ." at the root directory, or use it as a template for
# starting your own programs
#-----------------------------------------------------------------------------------------------
SET(sampleName DistributedSlam)
SET(PRJ_NAME "EXAMPLE_${sampleName}")
# ---------------------------------------
# Declare a new CMake Project:
# ---------------------------------------
PROJECT(${PRJ_NAME})
# These commands are needed by modern versions of CMake:
CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW) # Required by CMake 2.7+
endif(COMMAND cmake_policy)
# ---------------------------------------------------------------------------
# Set the output directory of each example to its corresponding subdirectory
# in the binary tree:
# ---------------------------------------------------------------------------
SET(EXECUTABLE_OUTPUT_PATH ".")
# --------------------------------------------------------------------------
# The list of "libs" which can be included can be found in:
# http://www.mrpt.org/Libraries
#
# The dependencies of a library are automatically added, so you only
# need to specify the top-most libraries your code depend on.
# --------------------------------------------------------------------------
FIND_PACKAGE(MRPT REQUIRED slam;vision;gui;topography;hwdrivers;obs)
# ---------------------------------------------
# TARGET:
# ---------------------------------------------
SET(SRCS
main.cpp
SerialPort.cpp SerialPort.h
KinectGrabber.h
)
# Define the executable target:
ADD_EXECUTABLE(${sampleName} ${SRCS})
SET_TARGET_PROPERTIES(
${sampleName}
PROPERTIES
PROJECT_LABEL "(EXAMPLE) ${sampleName}")
# Add special defines needed by this example, if any:
SET(MY_DEFS )
IF(MY_DEFS) # If not empty
ADD_DEFINITIONS("-D${MY_DEFS}")
ENDIF(MY_DEFS)
# Add the required libraries for linking:
TARGET_LINK_LIBRARIES(${sampleName}
${MRPT_LIBS} # This is filled by FIND_PACKAGE(MRPT ...)
"-lboost_system"
"-lboost_thread"
"-l pthread" # Optional extra libs...
)
# Set optimized building:
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT CMAKE_BUILD_TYPE MATCHES "Debug")