forked from AnimalLogic/AL_USDMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
125 lines (102 loc) · 3.6 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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
#This is a modified version of the cmake file from usd/sdk/maya/CMakeLists.txt
cmake_minimum_required(VERSION 2.8.12)
project(AL_USDMaya)
#set cmake modules - ";" separated not ":"!
list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults
${CMAKE_CURRENT_SOURCE_DIR}/cmake/macros
${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules
)
# AL_USDMAYA uses pxrConfig.cmake exported targets
# find_package(USD) can use either ${USD_ROOT}, or ${USD_CONFIG_FILE} (which should be ${USD_ROOT}/pxrConfig.cmake)
# to find USD, defined as either Cmake var or env var
find_package(USD REQUIRED)
include(${USD_CONFIG_FILE})
# to get PYTHON_EXECUTABLE
find_package(PythonInterp)
include(ProjectDefaults)
include(Public)
include(CXXDefaults)
add_definitions(${_PXR_CXX_DEFINITIONS})
find_package(Maya REQUIRED)
include_directories(${MAYA_INCLUDE_DIRS})
include_directories(${PXR_INCLUDE_DIRS})
# FindBoost is particularly buggy, and doesn't like custom boost locations.
# Adding specific components forces calls to _Boost_find_library, which
# is the rationale for listing them here.
set(Boost_FIND_COMPONENTS
python
thread
filesystem
)
if(WIN32)
list(APPEND Boost_FIND_COMPONENTS
chrono
)
endif()
find_package(Boost COMPONENTS
${Boost_FIND_COMPONENTS}
REQUIRED
)
set(NEED_BOOST_FILESYSTEM ON)
if(WIN32)
set(CMAKE_CXX_FLAGS
-std=c++11
"${_PXR_CXX_FLAGS}"
)
else()
set(CMAKE_CXX_FLAGS
-std=c++11
-msse3
"${_PXR_CXX_FLAGS}"
)
endif()
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
set(CMAKE_VERBOSE_MAKEFILE OFF)
option(BUILD_USDMAYA_SCHEMAS "Build optional schemas." ON)
option(BUILD_USDMAYA_TRANSLATORS "Build optional translators." ON)
option(VALIDATE_GENERATED_SCHEMAS "Generate schemas code and compare." OFF)
option(SKIP_USDMAYA_TESTS "Build tests" OFF)
if(NOT SKIP_USDMAYA_TESTS)
enable_testing()
endif()
set(AL_USDMAYA_LOCATION_NAME
"AL_USDMAYA_LOCATION"
CACHE
STRING
"Name of the environment variable used to store AL_USDMaya installation location"
)
# Build all the utils
set(EVENTS_INCLUDE_LOCATION ${CMAKE_CURRENT_LIST_DIR}/utils)
set(USDUTILS_INCLUDE_LOCATION ${CMAKE_CURRENT_LIST_DIR}/usdutils)
set(MAYAUTILS_INCLUDE_LOCATION ${CMAKE_CURRENT_LIST_DIR}/mayautils)
set(USDMAYAUTILS_INCLUDE_LOCATION ${CMAKE_CURRENT_LIST_DIR}/usdmayautils)
add_subdirectory(utils)
add_subdirectory(usdutils)
add_subdirectory(mayautils)
add_subdirectory(usdmayautils)
add_subdirectory(lib)
add_subdirectory(plugin)
if(BUILD_USDMAYA_SCHEMAS)
message(STATUS "Building AL_USDMayaSchemas")
set(SCHEMAS_PYTHON_MODULE AL.usd.maya.schemas)
set(SCHEMAS_PYTHON_PATH AL/usd/maya/schemas)
set(SCHEMAS_PACKAGE AL_USDMayaSchemas)
set(SCHEMAS_PYTHON_PACKAGE _AL_USDMayaSchemas)
set(SCHEMAS_TOKENS_PREFIX AL_USDMayaSchemas)
add_subdirectory(schemas)
if(BUILD_USDMAYA_TRANSLATORS)
message(STATUS "Building AL_USDMayaTranslators")
set(TRANSLATORS_PACKAGE AL_USDMayaTranslators)
add_subdirectory(translators)
endif()
endif()
get_property(LIBRARY_LOCATION GLOBAL PROPERTY GLOBAL_LIBRARY_LOCATION)
get_property(PYTHON_LIBRARY_LOCATION GLOBAL PROPERTY GLOBAL_PYTHON_LIBRARY_LOCATION)
configure_file(ALUsdMayaConfig.cmake.in ${PROJECT_BINARY_DIR}/ALUsdMayaConfig.cmake @ONLY)
install(FILES ${PROJECT_BINARY_DIR}/ALUsdMayaConfig.cmake
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT dev
)
install(CODE "message(STATUS \"POST INSTALL: Compiling python/pyc for ${CMAKE_INSTALL_PREFIX} ... \")")
install(CODE "execute_process(COMMAND python -m compileall ${CMAKE_INSTALL_PREFIX} )")