0431e7cb3c
Import osgXR from https://github.com/amalon/osgXR master branch into 3rdparty, specifically commit b7e222775553b529018ac4b847353327c24ae5d4, which is 0.3.7 with tweaks for building as a subproject in a subdirectory. This will allow VR support to be more conveniently built if not already installed, without having to fetch yet another dependency.
29 lines
755 B
CMake
29 lines
755 B
CMake
cmake_minimum_required(VERSION 3.11)
|
|
project(osgXR::examples)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
find_package(OpenSceneGraph REQUIRED COMPONENTS osgDB osgViewer)
|
|
|
|
if(CMAKE_PROJECT_NAME STREQUAL osgXR)
|
|
# If we're building from osgXR source tree, take a shortcut
|
|
set(osgXR_INCLUDE_DIR "../include")
|
|
set(osgXR_LIBRARY osgXR)
|
|
else()
|
|
# Otherwise, we'd normally use osgXR::osgXR, but osgXR_LIBRARY will do here
|
|
find_package(osgXR REQUIRED)
|
|
endif()
|
|
|
|
add_executable(osgteapot osgteapot.cpp)
|
|
|
|
target_include_directories(osgteapot
|
|
PRIVATE
|
|
${OPENGL_INCLUDE_DIR}
|
|
${OPENSCENEGRAPH_INCLUDE_DIRS}
|
|
)
|
|
|
|
target_link_libraries(osgteapot
|
|
PUBLIC
|
|
${OPENGL_LIBRARIES}
|
|
${OPENSCENEGRAPH_LIBRARIES}
|
|
${osgXR_LIBRARY}
|
|
)
|