This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
/
CMakeLists.txt
63 lines (51 loc) · 2 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
# iSAM master cmake file
# Michael Kaess, 2010
project(isam)
cmake_minimum_required (VERSION 2.6)
if(CMAKE_BINARY_DIR STREQUAL PROJECT_SOURCE_DIR)
message(FATAL_ERROR "\nPlease do not build in the source directory, but instead build in a separate directory. The iSAM Makefile provides useful shortcuts for using cmake. Type:\nmake distclean\nto remove any local cmake build files. Then simply type\nmake\nwhich will call cmake in the build/ directory.")
endif()
if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
message(STATUS "Build configuration: ${CMAKE_BUILD_TYPE}")
set (LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/lib" CACHE PATH
"Target directory for all libraries.")
set (EXECUTABLE_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/bin" CACHE PATH
"Target directory for all executables.")
# do not edit - use ccmake to change
option (PROFILE "Enable profiling" OFF)
option (USE_LCM "Compile with LCM interface (lcm library needed)" OFF)
if(NOT DEFINED USE_GUI)
# SDL is optional
find_package(SDL)
if (NOT SDL_FOUND)
message(WARNING "\nSDL not found, disabling GUI.")
set(USE_GUI_TMP OFF)
else(NOT SDL_FOUND)
set(USE_GUI_TMP ON)
endif()
option (USE_GUI "Compile with GUI (SDL library needed)" ${USE_GUI_TMP})
endif()
add_definitions(-Wall)
# note: -g automatic for Debug mode, -O3 -DNDEBUG automatic for Release
if(PROFILE)
message(STATUS "Profiling active")
add_definitions(-pg)
endif(PROFILE)
if(USE_LCM)
add_definitions(-DUSE_LCM)
endif(USE_LCM)
if(USE_GUI)
add_definitions(-DUSE_GUI)
endif(USE_GUI)
# Eigen3 is needed
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
find_package(Eigen3 REQUIRED)
include_directories(${EIGEN3_INCLUDE_DIR})
include_directories("${PROJECT_SOURCE_DIR}/include")
add_subdirectory(isamlib)
add_subdirectory(isam)
add_subdirectory(examples)
add_subdirectory(misc)