-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathCMakeLists.txt
37 lines (30 loc) · 1.08 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
cmake_minimum_required(VERSION 3.15)
project(dcsam)
# Set some compilation options.
set(CMAKE_CXX_STANDARD 17)
if (NOT CMAKE_BUILD_TYPE)
# Options: Debug, Release, MinSizeRel, RelWithDebInfo
message(STATUS "No build type selected, default to Release")
set(CMAKE_BUILD_TYPE "Release")
endif()
# Add option to enable testing
option(DCSAM_ENABLE_TESTS "Enable tests" OFF)
# External package dependencies.
find_package(GTSAM 4.2 REQUIRED)
find_package(Eigen3 3.3 REQUIRED)
# add_definitions(-march=native)
# add_definitions(-std=c++1z)
add_library(dcsam SHARED)
target_sources(dcsam PRIVATE src/DCSAM.cpp src/HybridFactorGraph.cpp)
target_include_directories(dcsam PUBLIC include)
target_link_libraries(dcsam PUBLIC Eigen3::Eigen gtsam)
target_compile_options(dcsam PRIVATE -Wall -Wpedantic -Wextra)
# Make library accessible to other cmake projects
export(PACKAGE dcsam)
export(TARGETS dcsam FILE dcsamConfig.cmake)
# Include unit tests directory to the project.
if(DCSAM_ENABLE_TESTS)
message(STATUS "Testing enabled. Building tests.")
enable_testing()
add_subdirectory(tests)
endif()