-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
49 lines (38 loc) · 2.26 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
cmake_minimum_required(VERSION 2.8)
project(OpenVR_Device_Viewer)
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
file(GLOB_RECURSE SOURCES src/*.cpp)
file(GLOB_RECURSE HEADERS include/*.hpp include/*.h)
file(GLOB IMGUI_SOURCES 3rdparty/imgui/*.cpp 3rdparty/imGuIZMO.quat/imGuIZMO.quat/*.cpp)
file(GLOB IMGUI_HEADERS 3rdparty/imgui/*.h 3rdparty/imgui/*.hpp 3rdparty/imGuIZMO.quat/imGuIZMO.quat/*.h)
set(CMAKE_CXX_STANDARD 17)
add_executable(OpenVR_Device_Viewer ${SOURCES} ${HEADERS})
target_include_directories(OpenVR_Device_Viewer PUBLIC include/)
# OpenVR headers and libs
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/openvr/headers)
target_link_libraries(OpenVR_Device_Viewer ${CMAKE_SOURCE_DIR}/3rdparty/openvr/lib/win64/openvr_api.lib)
file(COPY ${CMAKE_SOURCE_DIR}/3rdparty/openvr/bin/win64/openvr_api.dll DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug)
# Imgui headers and sources
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/imgui)
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/imgui/examples)
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/imGuIZMO.quat/imGuIZMO.quat)
add_library(imgui ${IMGUI_SOURCES} ${IMGUI_HEADERS})
target_link_libraries(OpenVR_Device_Viewer $<TARGET_LINKER_FILE:imgui>)
# GLFW headers and sources
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Docs")
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Examples")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Tests")
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdparty/glfw/)
add_dependencies(OpenVR_Device_Viewer glfw)
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/glfw/include)
target_link_libraries(OpenVR_Device_Viewer glfw ${GLFW_LIBRARIES})
# GLEW headers and libs
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/glew-2.1.0/include)
target_link_libraries(OpenVR_Device_Viewer ${CMAKE_SOURCE_DIR}/3rdparty/glew-2.1.0/lib/Release/x64/glew32.lib)
file(COPY ${CMAKE_SOURCE_DIR}/3rdparty/glew-2.1.0/bin/Release/x64/glew32.dll DESTINATION ${EXECUTABLE_OUTPUT_PATH}/Debug)
find_package(OpenGL REQUIRED)
target_link_libraries(OpenVR_Device_Viewer ${OPENGL_gl_LIBRARY})
# Eigen headers
target_include_directories(OpenVR_Device_Viewer PUBLIC 3rdparty/eigen-git-mirror)