-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 2.24 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
cmake_minimum_required(VERSION 3.1.0)
project(osvrUnityRenderingPlugin)
#-----------------------------------------------------------------------------
# Local CMake Modules
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
#-----------------------------------------------------------------------------
# This looks for an osvrConfig.cmake file - most of the time it can be
# autodetected but you might need to specify osvr_DIR to be something like
# C:/Users/Ryan/Desktop/build/OSVR-Core-vc12 or
# C:/Users/Ryan/Downloads/OSVR-Core-Snapshot-v0.1-406-gaa55515-build54-vs12-32bit
# in the CMake GUI or command line
find_package(osvr REQUIRED)
# Add one of these libraries for each vendor that we've got a driver
# for and add a No driver that tells that it is unavailable when we
# don't find the driver library.
find_package(OpenGL REQUIRED)
find_package(GLEW REQUIRED)
find_package(Boost REQUIRED)
find_package(osvrRenderManager REQUIRED)
find_package(JsonCpp REQUIRED)
set (osvrUnityRenderingPlugin_SOURCES
OsvrRenderingPlugin.h
OsvrRenderingPlugin.cpp
PluginConfig.h
UnityRendererType.h
)
if(WIN32)
# list(APPEND osvrUnityRenderingPlugin_SOURCES OsvrRenderingPlugin.def)
endif()
add_library(osvrUnityRenderingPlugin MODULE ${osvrUnityRenderingPlugin_SOURCES})
#set_target_properties(osvrUnityRenderingPlugin PROPERTIES LINK_FLAGS "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/OsvrRenderingPlugin.def")
target_link_libraries(osvrUnityRenderingPlugin osvr::osvrClientKit)
target_link_libraries(osvrUnityRenderingPlugin osvr::osvrResetYaw)
target_link_libraries(osvrUnityRenderingPlugin osvrRenderManager::osvrRenderManager)
target_include_directories(osvrUnityRenderingPlugin PRIVATE ${Boost_INCLUDE_DIRS})
# target_link_libraries(osvrUnityRenderingPlugin ${Boost_LIBRARIES})
if (OPENGL_FOUND AND GLEW_FOUND)
target_include_directories(osvrUnityRenderingPlugin PRIVATE ${OPENGL_INCLUDE_DIRS})
target_link_libraries(osvrUnityRenderingPlugin ${OPENGL_LIBRARY} GLEW::GLEW JsonCpp::JsonCpp)
# Handle static glew.
if(GLEW_LIBRARY MATCHES ".*s.lib")
target_compile_definitions(osvrUnityRenderingPlugin PRIVATE GLEW_STATIC)
endif()
endif()
# Install docs, license, sample config
install(TARGETS
osvrUnityRenderingPlugin
DESTINATION .)