-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·67 lines (65 loc) · 2.07 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
cmake_minimum_required(VERSION 3.13)
project(GraphSLAM)
###########
# Options #
###########
OPTION(BUILD_GRAPHPRED "compile with scene graph prediction" ON)
OPTION(BUILD_GUI "compile with GUI" ON)
OPTION(USE_RENDEREDVIEW "Enable generating rendered view for ScanNet and 3RScan dataset" ON)
###################
# Project setting #
###################
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function" )
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
#################################
# Specify the CMake module path #
#################################
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
SET(CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR} ${CMAKE_PREFIX_PATH})
#################################
# Add additional compiler flags #
#################################
IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libstdc++ -Wno-deprecated-declarations -Wno-unused-function")
ENDIF()
IF(NOT MSVC_IDE)
SET(CFLAGS_WARN "-Wall -Wextra -Wno-unused-parameter -Wno-strict-aliasing")
SET(CMAKE_CXX_FLAGS "-fPIC ${CFLAGS_WARN} ${CMAKE_CXX_FLAGS}")
ENDIF()
############
# External #
############
# set(OpenCV_DIR /home/lch/tools/opencv-4.0.1/build)
SET(WITH_OPENCV TRUE)
SET(WITH_EIGEN TRUE)
SET(WITH_TINYPLY TRUE)
SET(WITH_JSON TRUE)
INCLUDE(Usetinyply)
INCLUDE(UseJson)
INCLUDE(UseOpenMP)
if(APPLE)
set(INSEG_LIB ${PROJECT_SOURCE_DIR}/lib/libInSegLib_osx.a)
else()
set(INSEG_LIB ${PROJECT_SOURCE_DIR}/lib/libInSegLib_linux.a)
endif()
################
# Include dirs #
################
INCLUDE_DIRECTORIES(ORUtils/include)
######################
# Add subdirectories #
######################
IF(BUILD_GUI)
ADD_SUBDIRECTORY(libGUI3D)
ADD_SUBDIRECTORY(libGraphSLAMGUI)
ENDIF(BUILD_GUI)
ADD_SUBDIRECTORY(libDataLoader)
ADD_SUBDIRECTORY(libGraphSLAM)
ADD_SUBDIRECTORY(app)
set(CMAKE_INSTALL_PREFIX "${CMAKE_SOURCE_DIR}/install")
message(
"Set the cmake install dir to: ${CMAKE_SOURCE_DIR}/install\n"
)