Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,7 @@ if(BUILD_LOOKDEVXUSD_LIBRARY)
endif()
endif()

find_package(AdskUsdComponentCreator)
find_package(AR)

#------------------------------------------------------------------------------
Expand Down Expand Up @@ -345,6 +346,13 @@ if (BUILD_ADSK_PLUGIN)
add_subdirectory(plugin/adsk)
endif()

if (AdskUsdComponentCreator_FOUND)
message(STATUS "Building with Autodesk USD Component Creator support.")
add_subdirectory(plugin/AdskUsdComponentCreator)
else()
message(STATUS "Autodesk USD Component Creator not found. Skipping building the component creator plugin.")
endif()

#------------------------------------------------------------------------------
# install
#------------------------------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ def BuildAndInstall(context, buildArgs, stages):
extraArgs.append('-DPXR_USD_LOCATION="{pxrUsdLocation}"'
.format(pxrUsdLocation=context.pxrUsdLocation))

if context.usdComponentCreatorLocation:
extraArgs.append('-DADSK_USD_COMPONENT_CREATOR_ROOT_DIR="{usdComponentCreatorLocation}"'
.format(usdComponentCreatorLocation=context.usdComponentCreatorLocation))

if context.devkitLocation:
extraArgs.append('-DMAYA_DEVKIT_LOCATION="{devkitLocation}"'
.format(devkitLocation=context.devkitLocation))
Expand Down Expand Up @@ -630,6 +634,9 @@ def Package(context):
parser.add_argument("--pxrusd-location", type=str,
help="Directory where Pixar USD is installed.")

parser.add_argument("--usdcomponentcreator-location", type=str,
help="Directory where USD Component Creator is installed.")

parser.add_argument("--devkit-location", type=str,
help="Directory where Maya Devkit is installed.")

Expand Down Expand Up @@ -721,6 +728,9 @@ def __init__(self, args):
self.pxrUsdLocation = (os.path.abspath(args.pxrusd_location)
if args.pxrusd_location else None)

self.usdComponentCreatorLocation = (os.path.abspath(args.usdcomponentcreator_location)
if args.usdcomponentcreator_location else None)

# Maya Devkit Location
self.devkitLocation = (os.path.abspath(args.devkit_location)
if args.devkit_location else None)
Expand Down
157 changes: 157 additions & 0 deletions cmake/modules/FindAdskUsdComponentCreator.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
#
# Module to find AdskUsdComponentCreator.
#
# This module searches for a valid USD component creator installation.
# See the find_package at the bottom for the list of variables that will be set.
#

message(STATUS "Finding Autodesk USD Component Creator")

############################################################################
#
# Install root folder

if (NOT DEFINED ADSK_USD_COMPONENT_CREATOR_ROOT_DIR)
set(ADSK_USD_COMPONENT_CREATOR_ROOT_DIR $ENV{ADSK_USD_COMPONENT_CREATOR_ROOT_DIR})
endif()

# Make sure any backslashes from user input, possibly in env var
# or the command-line are replaced with forward slashes to be
# compatible with building paths in CMake.
string(REGEX REPLACE "\\\\" "/" ADSK_USD_COMPONENT_CREATOR_ROOT_DIR "${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}")

message(STATUS " Autodesk USD Component Creator given root is ${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}")

############################################################################
#
# C++ headers

find_path(ADSK_USD_COMPONENT_CREATOR_INCLUDE_DIR
NAMES
AdskUsdComponentCreator/AdskUsdComponentCreatorVersion.h
HINTS
${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}
PATH_SUFFIXES
include
DOC
"USD Component Creator C++ include headers folder"
)

############################################################################
#
# Link libraries

find_path(ADSK_USD_COMPONENT_CREATOR_LIBRARY_DIR
AdskUsdComponentCreator.lib
HINTS
${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}
PATH_SUFFIXES
lib
DOC
"USD Component Creator libraries folder"
)

set(ADSK_USD_COMPONENT_CREATOR_LIBS_TO_FIND
AdskUsdComponentCreator
AdskVariantEditor
sdf_tools
)

set(ADSK_USD_COMPONENT_CREATOR_LIBRARIES)

foreach(ADSK_USD_COMPONENT_CREATOR_LIB ${ADSK_USD_COMPONENT_CREATOR_LIBS_TO_FIND})
find_library(ADSK_USD_COMPONENT_CREATOR_${ADSK_USD_COMPONENT_CREATOR_LIB}_LIBRARY
NAMES
${ADSK_USD_COMPONENT_CREATOR_LIB}
HINTS
${ADSK_USD_COMPONENT_CREATOR_LIBRARY_DIR}
DOC
"USD Component Creator ${ADSK_USD_COMPONENT_CREATOR_LIB} library"
NO_CMAKE_SYSTEM_PATH
)
if (ADSK_USD_COMPONENT_CREATOR_${ADSK_USD_COMPONENT_CREATOR_LIB}_LIBRARY)
list(APPEND ADSK_USD_COMPONENT_CREATOR_LIBRARIES ${ADSK_USD_COMPONENT_CREATOR_${ADSK_USD_COMPONENT_CREATOR_LIB}_LIBRARY})
endif()
endforeach()

############################################################################
#
# Binaries, dynamic-libraries (DLL) and commands folder

if(IS_MACOSX)
set(ADSK_USD_COMPONENT_CREATOR_PLUGIN_EXT "dylib")
elseif(IS_WINDOWS)
set(ADSK_USD_COMPONENT_CREATOR_PLUGIN_EXT "dll")
elseif(IS_LINUX)
set(ADSK_USD_COMPONENT_CREATOR_PLUGIN_EXT "so")
else()
set(ADSK_USD_COMPONENT_CREATOR_PLUGIN_EXT "unknown")
endif()

find_path(ADSK_USD_COMPONENT_CREATOR_BIN_DIR
NAMES
AdskUsdComponentCreator.${ADSK_USD_COMPONENT_CREATOR_PLUGIN_EXT}
HINTS
${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}
PATH_SUFFIXES
bin
DOC
"USD Component Creator binaries (DLL and commands) folder"
)

############################################################################
#
# Maya plugin folder

find_path(ADSK_USD_COMPONENT_CREATOR_MAYA_PLUGIN_DIR
NAMES
usd_component_creator.py
HINTS
${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}
PATH_SUFFIXES
plugin
DOC
"USD Component Creator Maya plugin folder"
)

############################################################################
#
# Component creator version

if(ADSK_USD_COMPONENT_CREATOR_INCLUDE_DIR)
file(STRINGS ${MAYA_INCLUDE_DIR}/maya/MTypes.h ADSK_USD_COMPONENT_CREATOR_VERSION REGEX "#define ADSK_ADSK_USD_COMPONENT_CREATOR_VERSION \".*$\"")
if(ADSK_USD_COMPONENT_CREATOR_VERSION)
string(REGEX MATCHALL "[0-9]+" ADSK_USD_COMPONENT_CREATOR_VERSION ${ADSK_USD_COMPONENT_CREATOR_VERSION})
endif()
endif()

# Handle the QUIETLY and REQUIRED arguments and set ADSK_USD_COMPONENT_CREATOR_FOUND to TRUE if
# all listed variables are TRUE.

############################################################################
#
# Component creator package

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AdskUsdComponentCreator
REQUIRED_VARS
ADSK_USD_COMPONENT_CREATOR_ROOT_DIR
ADSK_USD_COMPONENT_CREATOR_INCLUDE_DIR
ADSK_USD_COMPONENT_CREATOR_LIBRARY_DIR
ADSK_USD_COMPONENT_CREATOR_MAYA_PLUGIN_DIR
ADSK_USD_COMPONENT_CREATOR_BIN_DIR
ADSK_USD_COMPONENT_CREATOR_LIBRARIES
VERSION_VAR
ADSK_USD_COMPONENT_CREATOR_VERSION
)

# Report to the user where the component creator package was found.

if (AdskUsdComponentCreator_FOUND)
message(STATUS " Autodesk USD Component Creator root folder is ${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}")
message(STATUS " Autodesk USD Component Creator include folder is ${ADSK_USD_COMPONENT_CREATOR_INCLUDE_DIR}")
message(STATUS " Autodesk USD Component Creator library folder is ${ADSK_USD_COMPONENT_CREATOR_LIBRARY_DIR}")
message(STATUS " Autodesk USD Component Creator Maya plugin folder is ${ADSK_USD_COMPONENT_CREATOR_MAYA_PLUGIN_DIR}")
message(STATUS " Autodesk USD Component Creator binaries folder is ${ADSK_USD_COMPONENT_CREATOR_BIN_DIR}")
message(STATUS " Autodesk USD Component Creator libraries are ${ADSK_USD_COMPONENT_CREATOR_LIBRARIES}")
endif()
39 changes: 39 additions & 0 deletions plugin/AdskUsdComponentCreator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
message("========== ADSK USD Component Creator Plugin ==========")

set(ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/../AdskUsdComponentCreator")
message(STATUS "Installing Autodesk USD Component Creator plugin into ${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}")

install(
FILES
${ADSK_USD_COMPONENT_CREATOR_ROOT_DIR}/usd_component_creator.mod
DESTINATION
${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}
)

install(
DIRECTORY
${ADSK_USD_COMPONENT_CREATOR_BIN_DIR}
DESTINATION
${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}
)

install(
DIRECTORY
${ADSK_USD_COMPONENT_CREATOR_INCLUDE_DIR}
DESTINATION
${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}
)

install(
DIRECTORY
${ADSK_USD_COMPONENT_CREATOR_LIBRARY_DIR}
DESTINATION
${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}
)

install(
DIRECTORY
${ADSK_USD_COMPONENT_CREATOR_MAYA_PLUGIN_DIR}
DESTINATION
${ADSK_USD_COMPONENT_CREATOR_INSTALL_DIR}
)