forked from PixarAnimationStudios/OpenUSD
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
65 lines (54 loc) · 1.83 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
58
59
60
61
62
63
64
65
project(usd)
if (WIN32)
cmake_minimum_required(VERSION 3.1.1)
else()
cmake_minimum_required(VERSION 2.8.8)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/defaults
${CMAKE_SOURCE_DIR}/cmake/modules
${CMAKE_SOURCE_DIR}/cmake/macros)
include(Options)
include(ProjectDefaults)
include(Packages)
# This has to be defined after Packages is included, because it relies on the
# discovered path to the python executable.
set(PXR_PYTHON_SHEBANG "${PYTHON_EXECUTABLE}"
CACHE
STRING
"Replacement path for Python #! line."
)
# CXXDefaults will set a variety of variables for the project.
# Consume them here. This is an effort to keep the most common
# build files readable.
include(CXXDefaults)
add_definitions(${_PXR_CXX_DEFINITIONS})
set(CMAKE_CXX_FLAGS "${_PXR_CXX_FLAGS} ${CMAKE_CXX_FLAGS}")
include(Public)
add_subdirectory(pxr)
add_subdirectory(extras)
function(_addIfExists pkg pkgCmakeLists)
if (EXISTS ${pkgCmakeLists})
add_subdirectory(${pkg})
else()
message(WARNING "Specified third party package '${pkgName}' was not found. Please check that '${pkgCmakeLists}' exists")
endif()
endfunction()
function(_enableThirdPartyPlugin identifier)
set(pkg third_party/${identifier})
set(pkgCmakeLists ${CMAKE_CURRENT_SOURCE_DIR}/${pkg}/CMakeLists.txt)
_addIfExists(${pkg} ${pkgCmakeLists})
endfunction()
if (${PXR_BUILD_KATANA_PLUGIN})
if (NOT ${PXR_BUILD_USD_IMAGING})
message(WARNING "Skipping third_party/katana because PXR_BUILD_USD_IMAGING=OFF")
else()
_enableThirdPartyPlugin("katana")
endif()
endif()
if (${PXR_BUILD_MAYA_PLUGIN})
if (NOT ${PXR_BUILD_USD_IMAGING})
message(WARNING "Skipping third_party/maya because PXR_BUILD_USD_IMAGING=OFF")
else()
_enableThirdPartyPlugin("maya")
endif()
endif()