forked from StableCoder/cmake-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindOpenXR.cmake
50 lines (34 loc) · 1.52 KB
/
FindOpenXR.cmake
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
#[=======================================================================[.rst:
FindOpenXR
----------
A library to import and export various 3d-model-formats including
scene-post-processing to generate missing render data.
http://OpenXR.org/
IMPORTED Targets
^^^^^^^^^^^^^^^^
This module defines :prop_tgt:`IMPORTED` target ``OpenXR::OpenXR``, if
yaml-cpp has been found.
Result Variables
^^^^^^^^^^^^^^^^
This module defines the following variables::
OpenXR_FOUND - "True" if yaml-cpp was found
OpenXR_INCLUDE_DIRS - include directories for yaml-cpp
OpenXR_LIBRARIES - link against this library to use yaml-cpp
The module will also define three cache variables::
OpenXR_INCLUDE_DIR - the yaml-cpp include directory
OpenXR_LIBRARY - the path to the yaml-cpp library
#]=======================================================================]
find_path(OpenXR_INCLUDE_DIR NAMES openxr/openxr.h)
find_library(OpenXR_LIBRARY NAMES openxr_loader Debug/openxr_loader)
set(OpenXR_INCLUDE_DIRS ${OpenXR_INCLUDE_DIR})
set(OpenXR_LIBRARIES ${OpenXR_LIBRARY})
find_package_handle_standard_args(OpenXR DEFAULT_MSG OpenXR_INCLUDE_DIR
OpenXR_LIBRARY)
mark_as_advanced(OpenXR_INCLUDE_DIR OpenXR_LIBRARY)
if(OpenXR_FOUND AND NOT TARGET OpenXR::OpenXR)
add_library(OpenXR::OpenXR UNKNOWN IMPORTED)
set_target_properties(
OpenXR::OpenXR
PROPERTIES IMPORTED_LOCATION "${OpenXR_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${OpenXR_INCLUDE_DIRS}")
endif()