forked from AnimalLogic/AL_USDMaya
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
91 lines (75 loc) · 2.84 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
#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)
# AL_USDMAYA uses pxrConfig.cmake exported targets
# Grab USD_CONFIG_FILE either as a cmake define or an environment variable
if(NOT USD_CONFIG_FILE)
if(NOT DEFINED ENV{USD_CONFIG_FILE})
message(FATAL_ERROR "Please set USD_CONFIG_FILE to the path to pxrConfig.cmake")
else()
set(USD_CONFIG_FILE $ENV{USD_CONFIG_FILE})
endif()
endif()
if(NOT EXISTS ${USD_CONFIG_FILE})
message( FATAL_ERROR "pxrConfig.cmake is needed, please set USD_CONFIG_FILE to a valid path")
else()
include(${USD_CONFIG_FILE})
endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
#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
)
# 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})
find_package(Qt5Gui REQUIRED)
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.
find_package(Boost COMPONENTS
python
REQUIRED
)
set(CMAKE_CXX_FLAGS
-std=c++11
-msse3
"${_PXR_CXX_WARNING_FLAGS}"
)
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)
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()
add_subdirectory(tests)
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
)