-
Notifications
You must be signed in to change notification settings - Fork 53
/
CMakeLists.txt
57 lines (41 loc) · 1.55 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
cmake_minimum_required(VERSION 2.6)
enable_testing()
project(gpslam CXX C)
# version indicator
set(GPSLAM_VERSION_MAJOR 0)
set(GPSLAM_VERSION_MINOR 1)
set(GPSLAM_VERSION_PATCH 0)
set(GPSLAM_VERSION_STRING "${GPSLAM_VERSION_MAJOR}.${GPSLAM_VERSION_MINOR}.${GPSLAM_VERSION_PATCH}")
# Find dependent libraries
# Find GTSAM components
find_package(GTSAM REQUIRED) # Uses installed package
include_directories(${GTSAM_INCLUDE_DIR})
set(GTSAM_LIBS gtsam)
find_package(GTSAMCMakeTools)
include(GtsamMakeConfigFile)
include(GtsamBuildTypes)
include(GtsamTesting)
# options
option(GPSLAM_BUILD_MATLAB_TOOLBOX "whether build matlab toolbox" OFF)
# for unittest scripts
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${GTSAM_DIR}/../GTSAMCMakeTools")
# Boost - same requirement as gtsam
find_package(Boost 1.46 REQUIRED)
find_package(Boost COMPONENTS filesystem REQUIRED)
find_package(Boost COMPONENTS system REQUIRED)
find_package(Boost COMPONENTS thread REQUIRED)
find_package(Boost COMPONENTS serialization REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
# include current source folder, at the very beginning
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR})
# Process source subdirs
add_subdirectory(gpslam)
# Wrapping to MATLAB
if(GPSLAM_BUILD_MATLAB_TOOLBOX)
include(GtsamMatlabWrap)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
wrap_and_install_library(gpslam.h ${PROJECT_NAME} "${CMAKE_CURRENT_SOURCE_DIR}" "")
endif()
# Install config and export files
GtsamMakeConfigFile(gpslam)
export(TARGETS ${gpslam_EXPORTED_TARGETS} FILE gpslam-exports.cmake)