forked from fixstars/libSGM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
55 lines (44 loc) · 1.8 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
cmake_minimum_required(VERSION 3.1)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CUDA_ARCH "-arch=sm_50" CACHE STRING "Value of the NVCC -arch option.")
if(${CMAKE_VERSION} VERSION_EQUAL 3.7 OR ${CMAKE_VERSION} VERSION_GREATER 3.7)
option(AUTO_DETECT_ARCH "Detect local GPU compute arch automatically" ON)
endif()
option(ENABLE_ZED_DEMO "Build a Demo using ZED Camera" OFF)
option(ENABLE_SAMPLES "Build samples" OFF)
option(ENABLE_TESTS "Test library" OFF)
option(LIBSGM_SHARED "Build a shared library" OFF)
option(BUILD_OPENCV_WRAPPER "Make library compatible with cv::Mat and cv::cuda::GpuMat of OpenCV" OFF)
if(WIN32)
set(ZED_SDK_LIB "C:\\Program Files (x86)\\ZED SDK\\lib\\sl_zed64.lib" CACHE STRING "ZED SDK library(sl_zed**.llb) path.")
set(ZED_SDK_INCLUDE_DIR "C:\\Program Files (x86)\\ZED SDK\\include" CACHE STRING "ZED SDK include path.")
else()
set(ZED_SDK_LIB "/usr/local/zed/lib/libsl_zed.so" CACHE STRING "ZED SDK library(sl_zed**.llb) path.")
set(ZED_SDK_INCLUDE_DIR "/usr/local/zed/include" CACHE STRING "ZED SDK include path.")
endif()
project(libSGM VERSION 2.7.0)
if(BUILD_OPENCV_WRAPPER)
find_package(OpenCV REQUIRED core)
include_directories(${OpenCV_INCLUDE_DIRS})
endif()
configure_file(${PROJECT_SOURCE_DIR}/include/libsgm_config.h.in
${PROJECT_SOURCE_DIR}/include/libsgm_config.h
)
add_subdirectory(src)
if(ENABLE_SAMPLES)
add_subdirectory(sample/image)
add_subdirectory(sample/movie)
add_subdirectory(sample/reprojection)
add_subdirectory(sample/sgm_interface_fast_system)
add_subdirectory(sample/benchmark)
if(BUILD_OPENCV_WRAPPER)
add_subdirectory(sample/image_cv_gpumat)
endif()
endif()
if(ENABLE_TESTS)
add_subdirectory(test)
endif()
if(ENABLE_ZED_DEMO)
add_subdirectory(sample/zed)
endif()