forked from sauravag/edpl-ompl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
145 lines (125 loc) · 4.44 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
141
142
143
cmake_minimum_required(VERSION 2.8)
if(${CMAKE_VERSION} VERSION_GREATER 2.8.3)
cmake_policy(SET CMP0017 NEW)
endif()
if(NOT ${CMAKE_VERSION} VERSION_LESS 3.0.0)
cmake_policy(SET CMP0042 OLD)
endif()
project(bspapp CXX C)
# set the default build type
if (NOT CMAKE_BUILD_TYPE)
# By default, use Debug mode
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Type of build" FORCE)
endif()
message(STATUS "Building ${CMAKE_BUILD_TYPE}")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR})
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/share/cmake-2.8/Modules/" "${PROJECT_SOURCE_DIR}/CMakeModules/")
if(APPLE)
set(QT_QMAKE_EXECUTABLE /opt/local/libexec/qt4/bin/qmake)
endif()
if(APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
include(GetPrerequisites)
get_prerequisites("${Boost_SYSTEM_LIBRARY}" _libs 0 0 "/" "")
set(CXXSTDLIB "")
foreach(_lib ${_libs})
if(_lib MATCHES "libc\\+\\+")
set(CXXSTDLIB "libc++")
elseif(_lib MATCHES "libstdc\\+\\+")
set(CXXSTDLIB "libstdc++")
endif()
endforeach()
if(CXXSTDLIB)
add_definitions(-stdlib=${CXXSTDLIB})
endif()
endif()
# reqd packages
find_package(Boost QUIET 1.54)
find_package(Boost COMPONENTS date_time thread serialization filesystem system program_options unit_test_framework chrono REQUIRED)
find_package(OpenGL REQUIRED)
find_package(Qt4 4.4.3 REQUIRED QtCore QtGui QtXml REQUIRED)
find_package(OMPL REQUIRED)
find_package(Armadillo REQUIRED)
find_package(TINYXML REQUIRED)
set(QT_USE_QTOPENGL true)
# here we specify the additional include directories for the project. These files come in additional include directories option of VC++
# project.
# either the variable values from package like ${PCL_INCLUDE_DIRS} or absolute paths as shown in second and third line may be used.
include_directories(
${PROJECT_SOURCE_DIR}/include/
${Boost_INCLUDE_DIRS}
${OPENGL_INCLUDE_DIRS}
${Qt4_INCLUDE_DIRS}
${OMPL_INCLUDE_DIRS}
${ARMADILLO_INCLUDE_DIRS}
${QT_INCLUDES}
${TINYXML_INCLUDE_DIR}
${GLUT_INCLUDE_DIR}
)
include(${QT_USE_FILE})
# here we specify the additional library directories for the linker in the project. These files come in additional library directories
# option of VC++ project.
# either the variable values from package like ${PCL_LIBRARY_DIRS} or absolute paths as shown in second and third line may be used.
# An update, link_directories is being pulled out, you may use TARGET_LINK_LIBRARIES instead as shown below
link_directories(${Boost_LIBRARY_DIRS}
${OPENGL_LIBRARY_DIRS}
${Qt4_LIBRARY_DIRS}
${OMPL_LIBRARY_DIRS}
${OMPLAPP_LIBRARY_DIRS}
${TINYXML_LIBRARY_DIRS}
)
# We have commented out ROSSpaceInformation.cpp so that
# this project can build and run without ROS.
# To do ros based stuff, add catkinized cmake directives
# to turn it into a ros node and compile for example
# M3PROSDemo.cpp as executable instead of main.
add_library (bsp_lib
src/MotionModels/TwoDPointMotionModel.cpp
src/MotionModels/OmnidirectionalMotionModel.cpp
src/MotionModels/UnicycleMotionModel.cpp
src/MotionModels/UnicycleStatePropagator.cpp
src/MotionModels/OmnidirectionalStatePropagator.cpp
src/MotionModels/TwoDPointStatePropagator.cpp
src/ObservationModels/CamAruco2DObservationModel.cpp
src/ObservationModels/TwoDBeaconObservationModel.cpp
src/ObservationModels/HeadingBeaconObservationModel.cpp
src/Planner/FIRM.cpp
src/Planner/NBM3P.cpp
src/Samplers/GaussianValidBeliefSampler.cpp
src/Samplers/UniformValidBeliefSampler.cpp
src/SeparatedControllers/RHCICreate.cpp
src/SeparatedControllers/FiniteTimeLQR.cpp
src/SeparatedControllers/StationaryLQR.cpp
#src/SpaceInformation/ROSSpaceInformation.cpp
src/SpaceInformation/SpaceInformation.cpp
src/Spaces/SE2BeliefSpace.cpp
src/Spaces/R2BeliefSpace.cpp
src/Utils/FIRMUtils.cpp
src/Visualization/GLWidget.cpp
src/Visualization/Visualizer.cpp
src/Visualization/Window.cpp
src/Visualization/moc_GLWidget.cpp
src/Visualization/moc_Window.cpp
src/Filters/ExtendedKF.cpp
src/Filters/LinearizedKF.cpp
)
target_link_libraries (bsp_lib
${Boost_LIBRARIES}
${QT_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARIES}
${TINYXML_LIBRARIES}
${ARMADILLO_LIBRARIES}
${OMPL_LIBRARY}
${OMPLAPP_LIBRARY}
)
# Add the main as executable
add_executable (bsp-app-demo src/main.cpp)
# make sure libfcl.so is in /usr/local/lib/
target_link_libraries (bsp-app-demo
bsp_lib
${OMPLAPP_LIBRARY}
${OMPLAPPBASE_LIBRARY}
libfcl.so
)