| 1 |
cmake_minimum_required(VERSION 3.11) |
| 2 |
project(osgXR::examples) |
| 3 |
|
| 4 |
find_package(OpenGL REQUIRED) |
| 5 |
find_package(OpenSceneGraph REQUIRED COMPONENTS osgDB osgViewer) |
| 6 |
|
| 7 |
if(CMAKE_PROJECT_NAME STREQUAL osgXR) |
| 8 |
# If we're building from osgXR source tree, take a shortcut |
| 9 |
set(osgXR_INCLUDE_DIR "../include") |
| 10 |
set(osgXR_LIBRARY osgXR) |
| 11 |
else() |
| 12 |
# Otherwise, we'd normally use osgXR::osgXR, but osgXR_LIBRARY will do here |
| 13 |
find_package(osgXR REQUIRED) |
| 14 |
endif() |
| 15 |
|
| 16 |
add_executable(osgteapot osgteapot.cpp) |
| 17 |
|
| 18 |
target_include_directories(osgteapot |
| 19 |
PRIVATE |
| 20 |
${OPENGL_INCLUDE_DIR} |
| 21 |
${OPENSCENEGRAPH_INCLUDE_DIRS} |
| 22 |
) |
| 23 |
|
| 24 |
target_link_libraries(osgteapot |
| 25 |
PUBLIC |
| 26 |
${OPENGL_LIBRARIES} |
| 27 |
${OPENSCENEGRAPH_LIBRARIES} |
| 28 |
${osgXR_LIBRARY} |
| 29 |
) |