forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpxrConfig.cmake.in
97 lines (88 loc) · 3.4 KB
/
pxrConfig.cmake.in
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# - Configuration file for the pxr project
# Defines the following variables:
# PXR_MAJOR_VERSION - Major version number.
# PXR_MINOR_VERSION - Minor version number.
# PXR_PATCH_VERSION - Patch version number.
# PXR_VERSION - Complete pxr version string.
# PXR_INCLUDE_DIRS - Root include directory for the installed project.
# PXR_LIBRARIES - List of all libraries, by target name.
# PXR_foo_LIBRARY - Absolute path to individual libraries.
# The preprocessor definition PXR_STATIC will be defined if appropriate
get_filename_component(PXR_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(PXR_MAJOR_VERSION "@PXR_MAJOR_VERSION@")
set(PXR_MINOR_VERSION "@PXR_MINOR_VERSION@")
set(PXR_PATCH_VERSION "@PXR_PATCH_VERSION@")
set(PXR_VERSION "@PXR_VERSION@")
# If Python support was enabled for this USD build, find the import
# targets by invoking the appropriate FindPython module. Use the same
# LIBRARY and INCLUDE_DIR settings from the original build if they
# were set. This can be overridden by specifying different values when
# running cmake.
if(@PXR_ENABLE_PYTHON_SUPPORT@)
if (NOT DEFINED Python3_EXECUTABLE)
if (NOT [[@Python3_EXECUTABLE@]] STREQUAL "")
set(Python3_EXECUTABLE [[@Python3_EXECUTABLE@]])
endif()
endif()
if (NOT DEFINED Python3_LIBRARY)
if (NOT [[@Python3_LIBRARY@]] STREQUAL "")
set(Python3_LIBRARY [[@Python3_LIBRARY@]])
endif()
endif()
if (NOT DEFINED Python3_INCLUDE_DIR)
if (NOT [[@Python3_INCLUDE_DIR@]] STREQUAL "")
set(Python3_INCLUDE_DIR [[@Python3_INCLUDE_DIR@]])
endif()
endif()
if (NOT DEFINED Python3_VERSION)
find_package(Python3 "@Python3_VERSION@" EXACT COMPONENTS Development REQUIRED)
else()
find_package(Python3 COMPONENTS Development REQUIRED)
endif()
endif()
# If MaterialX support was enabled for this USD build, try to find the
# associated import targets by invoking the same FindMaterialX.cmake
# module that was used for that build. This can be overridden by
# specifying a different MaterialX_DIR when running cmake.
if(@PXR_ENABLE_MATERIALX_SUPPORT@)
if (NOT DEFINED MaterialX_DIR)
if (NOT [[@MaterialX_DIR@]] STREQUAL "")
set(MaterialX_DIR [[@MaterialX_DIR@]])
endif()
endif()
find_package(MaterialX REQUIRED)
endif()
# Similar to MaterialX above, we are using Imath's cmake package config, so set
# the Imath_DIR accordingly to find the associated import targets which were
# used for this USD build.
# Note that we only need to do this, when it is determined by Imath is being
# used instead of OpenExr (refer Packages.cmake)
if(@Imath_FOUND@)
if (NOT DEFINED Imath_DIR)
if (NOT [[@Imath_DIR@]] STREQUAL "")
set(Imath_DIR [[@Imath_DIR@]])
endif()
endif()
find_package(Imath REQUIRED)
endif()
include("${PXR_CMAKE_DIR}/cmake/pxrTargets.cmake")
if (TARGET usd_ms)
set(libs "usd_ms")
else()
set(libs "@PXR_ALL_LIBS@")
endif()
set(PXR_LIBRARIES "")
set(PXR_INCLUDE_DIRS "${PXR_CMAKE_DIR}/include")
string(REPLACE " " ";" libs "${libs}")
foreach(lib ${libs})
get_target_property(location ${lib} LOCATION)
set(PXR_${lib}_LIBRARY ${location})
list(APPEND PXR_LIBRARIES ${lib})
endforeach()
if(NOT @BUILD_SHARED_LIBS@)
if(WIN32)
list(APPEND PXR_LIBRARIES Shlwapi.lib)
list(APPEND PXR_LIBRARIES Dbghelp.lib)
endif()
add_definitions(-DPXR_STATIC)
endif()