-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (55 loc) · 1.88 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
set(OCULUS_PATH "OCULUS_SDK_ROOT_DIR-NOTFOUND" REQUIRED CACHE STRING "Path of OVR SDK folder. eg: C:\\ovr_sdk_win_0.17.0\\OculusSDK")
set(SDL_PATH "SDL2_ROOT_DIR-NOTFOUND" REQUIRED CACHE STRING "Path of SDL2 folder. eg: C:\\SDL2-2.0.3")
project(ZED_Stereo_Passthrough)
cmake_minimum_required(VERSION 3.1)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 OLD)
cmake_policy(SET CMP0015 OLD)
endif(COMMAND cmake_policy)
set(CMAKE_CXX_STANDARD 11)
# Mandatory
find_package(ZED 3 REQUIRED)
find_package(GLEW REQUIRED)
find_package(CUDA REQUIRED)
find_package(OpenGL 3.0 REQUIRED)
set(OCULUS_LIBRARY_DIRS ${OCULUS_PATH}/LibOVR/Lib/Windows/x64/Release/VS2015)
set(SDL_LIBRARY_DIRS ${SDL_PATH}/lib/x64)
set(OCULUS_INCLUDE_DIRS ${OCULUS_PATH}/LibOVR/Include ${OCULUS_PATH}/LibOVRKernel/Src)
set(OCULUS_LIBRARIES LibOVR)
set(SDL_INCLUDE_DIRS ${SDL_PATH}/include)
set(SDL_LIBRARIES SDL2 SDL2main)
set(SRC_FOLDER src)
file(GLOB_RECURSE SRC_FILES "${SRC_FOLDER}/*.cpp")
add_executable(${CMAKE_PROJECT_NAME} ${SRC_FILES})
target_include_directories(${CMAKE_PROJECT_NAME} PUBLIC
${ZED_INCLUDE_DIRS}
${GLUT_INCLUDE_DIRS}
${CMAKE_CURRENT_SOURCE_DIR}/include
${OCULUS_INCLUDE_DIRS}
${SDL_INCLUDE_DIRS}
${CUDA_INCLUDE_DIRS}
)
target_link_directories(${CMAKE_PROJECT_NAME} PUBLIC
${ZED_LIBRARY_DIR}
${GLUT_LIBRARY_DIRS}
${OpenGL_LIBRARY_DIRS}
${SDL_LIBRARY_DIRS}
${OCULUS_LIBRARY_DIRS}
${CUDA_LIBRARY_DIRS}
)
add_definitions(-O3)
set_property(TARGET ${CMAKE_PROJECT_NAME} PROPERTY OUTPUT_NAME "ZED Stereo Passthrough")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
# Add the required libraries for linking:
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE
${ZED_LIBRARIES}
${OPENGL_LIBRARIES}
${GLUT_LIBRARY}
${GLEW_LIBRARIES}
${SDL_LIBRARIES}
${OCULUS_LIBRARIES}
${CUDA_CUDA_LIBRARY}
${CUDA_CUDART_LIBRARY}
${CUDA_NPP_LIBRARIES_ZED}
)