-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
58 lines (43 loc) · 1.83 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
# CMake minimum version requirement
cmake_minimum_required(VERSION 2.8)
# Name
project( VimeoDepthViewer )
### Compilation flags: adapt to your needs ###
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /bigobj") ### Enable parallel compilation
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR} )
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR} )
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif()
# RealSense lib
set(DHWM_OVER_XU OFF)
set(BUILD_EXAMPLES OFF)
# Disable building extras we won't need (pure C++ project)
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE)
set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE)
# Add the configurations from nanogui
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/nanogui)
# Various preprocessor definitions have been generated by NanoGUI
add_definitions(${NANOGUI_EXTRA_DEFS})
# On top of adding the path to nanogui/include, you may need extras
include_directories(${NANOGUI_EXTRA_INCS})
# Add referecne
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/nanogui/include")
# For reliability of parallel build, make the NanoGUI targets dependencies
set_property(TARGET glfw glfw_objects nanogui PROPERTY FOLDER "dependencies")
# Add the configurations from librealsense
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/ext/librealsense")
# Add referecne
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/librealsense/include")
### Include Eigen for linear algebra
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/ext/eigen")
# Compile all the cpp files in src
file(GLOB SOURCES
"${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp"
)
# Build an executable
add_executable(${PROJECT_NAME} ${SOURCES})
# Link the OpenCV lib
target_link_libraries( VimeoDepthViewer nanogui ${NANOGUI_EXTRA_LIBS} realsense2 )