-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
61 lines (49 loc) · 1.73 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
cmake_minimum_required(VERSION 3.0)
project(gtsam_gnss CXX C)
# Enforce c++17 standards
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(MSVC)
add_compile_options(-DBOOST_ALL_NO_LIB)
set(GTSAMCMakeTools_DIR "C:/Program Files (x86)/GTSAM/CMake/GTSAMCMakeTools")
set(gtwrap_DIR "C:/Program Files (x86)/GTSAM/CMake/gtwrap")
set(CMAKE_INSTALL_PREFIX "C:/Program Files (x86)/GTSAM")
endif(MSVC)
# Find GTSAM components
find_package(GTSAM REQUIRED)
if(GTSAM_NOT_FOUND)
message(FATAL_ERROR "This program requires the GTSAM library.")
endif(GTSAM_NOT_FOUND)
# Include GTSAM CMake tools
find_package(GTSAMCMakeTools)
# Import gtwrap package
find_package(gtwrap)
set(WRAP_PYTHON_VERSION
"Default"
CACHE STRING "The Python version to use for wrapping")
gtwrap_get_python_version(${WRAP_PYTHON_VERSION})
set(WRAP_TOOLBOX_INSTALL_PATH
"${CMAKE_INSTALL_PREFIX}/gtsam_toolbox"
CACHE
PATH
"Matlab toolbox destination")
# Include the Matlab related code
include(MatlabWrap)
# Include project headers
include_directories("${PROJECT_SOURCE_DIR}/src")
# Add sorce code directory
add_subdirectory(src)
# Install library
install(
TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin)
# ##############################################################################
# Build MATLAB wrapper
matlab_wrap("gtsam_gnss.i" "${PROJECT_NAME}" "" "" "${mexFlags}" "${FilesToIgnore}" OFF)
message("========== Configuration Options ==========")
message(STATUS "Project: ${PROJECT_NAME}")
message(STATUS "MATLAB Root: ${MATLAB_ROOT}")
message(STATUS "Mex Compiler: ${Matlab_MEX_COMPILER}")
message("===========================================")