Skip to content

Commit

Permalink
New repo and install directory design changes (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
HamedSabri-adsk authored Jul 23, 2019
1 parent 141bab7 commit e5e10a2
Show file tree
Hide file tree
Showing 957 changed files with 3,884 additions and 8,470 deletions.
66 changes: 23 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
#-
#*****************************************************************************
# =======================================================================
# Copyright 2019 Autodesk, Inc. All rights reserved.
#
# These coded instructions, statements, and computer programs contain
# unpublished proprietary information written by Autodesk, Inc. and are
# protected by Federal copyright law. They may not be disclosed to third
# parties or copied or duplicated in any form, in whole or in part, without
# the prior written consent of Autodesk, Inc.
#*****************************************************************************
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

# http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# =======================================================================
#+

cmake_minimum_required(VERSION 3.1.1)

#==============================================================================
# Define common build variables
#==============================================================================
set(BUILD_MAYAUSD_CORE_LIBRARY ON CACHE BOOL "Build Core USD libraries.")
set(BUILD_ADSK_USD_PLUGIN ON CACHE BOOL "Build Autodesk USD plugin.")
set(BUILD_PXR_USD_PLUGIN ON CACHE BOOL "Build the Pixar USD plugin and libraries.")
set(BUILD_AL_USD_PLUGIN ON CACHE BOOL "Build the Animal Logic USD plugin and libraries.")
set(BUILD_PXR_PLUGIN ON CACHE BOOL "Build the Pixar USD plugin and libraries.")
set(BUILD_AL_PLUGIN ON CACHE BOOL "Build the Animal Logic USD plugin and libraries.")

#==============================================================================
# Modules and Definitions
Expand All @@ -28,11 +32,6 @@ list(APPEND CMAKE_MODULE_PATH
${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults
)

if (BUILD_MAYAUSD_CORE_LIBRARY)
include(cmake/mayausd_version.info)
set(MAYAUSD_VERSION "${MAYAUSD_MAJOR_VERSION}.${MAYAUSD_MINOR_VERSION}.${MAYAUSD_PATCH_LEVEL}")
endif()

if (APPLE)
set(OSX_ARCHITECTURES "x86_64")
add_definitions(-DOSMac_ -DMAC_PLUGIN)
Expand Down Expand Up @@ -61,49 +60,30 @@ if(NOT WIN32)
endif()
string(REPLACE ";" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")

#==============================================================================
# CORE
#==============================================================================
if (BUILD_MAYAUSD_CORE_LIBRARY)

# set build location
set(MAYAUSD_BUILD_ROOT "${CMAKE_CURRENT_BINARY_DIR}/build-mayaUsd")

# Including this file will end up calling ExternalProjet_Add which we use to
# perform the MayaUSD build. Note: That external project is executed immediately
# during the 'configure' phase of the AL_USDMaya cmake. This means that MayaUSD
# will perform the cmake config/build/install steps all at once. This is needed
# because AL_USDMaya needs to find an 'install' of MayaUSD.
include("core/MayaUsd.cmake")
endif()

#==============================================================================
# PLUGINS
#==============================================================================
if (BUILD_PXR_USD_PLUGIN)
add_subdirectory(plugins/PXR_USDMaya)
if (BUILD_PXR_PLUGIN)
add_subdirectory(plugin/pxr)
endif()

if (BUILD_AL_USD_PLUGIN)
if(BUILD_USDMAYA_PXR_TRANSLATORS AND NOT BUILD_PXR_USD_PLUGIN)
if (BUILD_AL_PLUGIN)
if(BUILD_USDMAYA_PXR_TRANSLATORS AND NOT BUILD_PXR_PLUGIN)
message(FATAL_ERROR "Animal logic's pixar translator depends on pixar plugin!")
endif()

add_subdirectory(plugins/AL_USDMaya)
add_subdirectory(plugin/al)

if(BUILD_USDMAYA_PXR_TRANSLATORS)
add_dependencies(AL_USDMayaPxrTranslators usdMaya)
endif()
endif()

if (BUILD_ADSK_USD_PLUGIN)
add_subdirectory(plugins/ADSK_USDMaya)
endif()

#==============================================================================
# Install Maya-USD.module
# Install mayaUSD.mod
#==============================================================================
configure_file(Maya-USD.module.template ${PROJECT_BINARY_DIR}/Maya-USD.module)
install(FILES ${PROJECT_BINARY_DIR}/Maya-USD.module
configure_file(mayaUSD.mod.template ${PROJECT_BINARY_DIR}/mayaUSD.mod)
install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod
DESTINATION ${CMAKE_INSTALL_PREFIX}
)
25 changes: 0 additions & 25 deletions Maya-USD.module.template

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

USD for Maya is a project to create a Maya plugin, as well as reusable libraries, that provide translation and editing capabilities for Pixar Animation Studios Universal Scene Description (USD).

Read more about Pixars USD [here](http://openusd.org)
Read more about Pixar's USD [here](http://openusd.org)


## Motivation
*Why yet another Maya plugin?*

As USD gains in popularity many studios have been wondering what plugin they should deploy within their pipelines. Two popular choices, used individually as well as together, have been the Pixar USDMaya plugin that has been part of USD itself, and Animal Logic's, which was separately released as Open Source. Both of these plugins have a strong community of users, but some have questioned when Autodesk would eventually release an officially supported plugin themselves. The goal of this project is to work directly with Pixar and Animal Logic, as well as other key contributors, in order to merge the best of both into a single supported plugin.
As USD gains in popularity many studios have been wondering what plugin they should deploy within their pipelines. Two popular choices, used individually as well as together, have been the Pixar USDMaya plugin that has been part of USD itself, and Animal Logic's, which was separately released as Open Source. Both plugins have a strong community of users, but some have questioned when Autodesk would eventually release an officially supported plugin themselves. The goal of this project is to work directly with Pixar and Animal Logic, as well as other key contributors, in order to merge the best of both into a single supported plugin.

Pixar maintains a list of contributors to USD in their documentation [here](https://graphics.pixar.com/usd/docs/USD-Contributors.html), and as we start working together to merge the two existing plugins it is also important to acknowlege the amount of work that individuals put in on the Animal Logic plugin as well. The list of those contributors is kept [here](docs/AL_CONTRIBUTORS.md).
Pixar maintains a list of contributors to USD in their documentation [here](https://graphics.pixar.com/usd/docs/USD-Contributors.html), and as we start working together to merge the two existing plugins it is also important to acknowledge the amount of work that individuals put in on the Animal Logic plugin as well. The list of those contributors is kept [here](doc/AL_CONTRIBUTORS.md).

## Getting Help
Both Animal Logic and Pixar have their own Google interest groups which will remain great places to go with questions.
Expand All @@ -21,6 +21,7 @@ Animal Lock forum is [here](https://groups.google.com/forum/#!forum/al_usdmaya-d

## Detailed Documentation

+ [Contributing](docs/CONTRIBUTING.md)
+ [Building](docs/build.md)
+ [Devloper](docs/DEVELOPER.md)
+ [Contributing](doc/CONTRIBUTING.md)
+ [Building](doc/build.md)
+ [License](doc/LICENSE.md)
+ [Developer](doc/DEVELOPER.md)
52 changes: 33 additions & 19 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,12 +225,11 @@ def CurrentWorkingDirectory(dir):
def RunCMake(context, force, extraArgs=None):
"""Invoke CMake to configure, build, and install a library whose
source code is located in the current working directory."""
# Create a directory for out-of-source builds in the build directory
# using the name of the current working directory.

srcDir = os.getcwd()
instDir = (context.mayaUsdInstDir if srcDir == context.mayaUsdSrcDir
else srcDir == context.mayaUsdSrcDir)
instDir = context.instDir
buildDir = os.path.join(context.buildDir, os.path.split(srcDir)[1])

if force and os.path.isdir(buildDir):
shutil.rmtree(buildDir)

Expand Down Expand Up @@ -260,6 +259,10 @@ def RunCMake(context, force, extraArgs=None):
variant= BuildVariant(context)

with CurrentWorkingDirectory(buildDir):
# recreate build_log.txt everytime the script runs
if os.path.isfile(context.logFileLocation):
os.remove(context.logFileLocation)

Run('cmake '
'-DCMAKE_INSTALL_PREFIX="{instDir}" '
'-DCMAKE_BUILD_TYPE={variant} '
Expand Down Expand Up @@ -306,16 +309,20 @@ def InstallMayaUSD(context, force, buildArgs):
parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter)

parser.add_argument("install_dir", type=str,
help="Directory where project will be installed")
parser.add_argument("workspace_location", type=str,
help="Directory where the project use as a workspace to build and install plugin/libraries.")

parser.add_argument("--generator", type=str,
help=("CMake generator to use when building libraries with "
"cmake"))

parser.add_argument("--build_dir", type=str,
help=("Build directory for project"
"(default: <install_dir>/build_dir)"))
parser.add_argument("--build-location", type=str,
help=("Set Build directory"
"(default: <workspace_location>/build-location)"))

parser.add_argument("--install-location", type=str,
help=("Set Install directory"
"(default: <workspace_location>/install-location)"))

parser.add_argument("--maya-location", type=str,
help="Directory where Maya is installed.")
Expand Down Expand Up @@ -359,12 +366,16 @@ def __init__(self, args):
self.mayaUsdSrcDir = os.path.normpath(
os.path.join(os.path.abspath(os.path.dirname(__file__))))

# Directory where plugins and libraries will be installed
self.mayaUsdInstDir = os.path.abspath(args.install_dir)
# Workspace directory
self.workspaceDir = os.path.abspath(args.workspace_location)

# Build directory
self.buildDir = (os.path.abspath(args.build_location) if args.build_location
else os.path.join(self.workspaceDir, "build"))

# Directory where plugins and libraries will be built
self.buildDir = (os.path.abspath(args.build_dir) if args.build_dir
else os.path.join(self.mayaUsdInstDir, "build"))
# Install directory
self.instDir = (os.path.abspath(args.install_location) if args.install_location
else os.path.join(self.workspaceDir, "install"))

# Build type
self.buildDebug = args.build_debug
Expand Down Expand Up @@ -396,6 +407,7 @@ def __init__(self, args):

# Log File Name
self.logFileName="build_log.txt"
self.logFileLocation=os.path.join(self.buildDir, os.path.basename(os.getcwd()),self.logFileName)

# Build arguments
self.buildArgs = list()
Expand All @@ -413,21 +425,23 @@ def __init__(self, args):
summaryMsg = """
Building with settings:
Source directory {mayaUsdSrcDir}
Install directory {mayaUsdInstDir}
Workspace directory {workspaceDir}
Build directory {buildDir}
Install directory {instDir}
Variant {buildVariant}
CMake generator {cmakeGenerator}
Build Log {logFileName}"""
Build Log {logFileLocation}"""

if context.buildArgs:
summaryMsg += """
Extra Build arguments {buildArgs}"""

summaryMsg = summaryMsg.format(
mayaUsdSrcDir=context.mayaUsdSrcDir,
mayaUsdInstDir=context.mayaUsdInstDir,
workspaceDir=context.workspaceDir,
buildDir=context.buildDir,
logFileName=os.path.join(context.buildDir,context.logFileName),
instDir=context.instDir,
logFileLocation=context.logFileLocation,
buildArgs=context.buildArgs,
buildVariant=BuildVariant(context),
cmakeGenerator=("Default" if not context.cmakeGenerator
Expand All @@ -440,7 +454,7 @@ def __init__(self, args):
InstallMayaUSD(context, context.forceBuild, context.buildArgs)

# Ensure directory structure is created and is writable.
for dir in [context.mayaUsdInstDir, context.buildDir]:
for dir in [context.workspaceDir, context.buildDir]:
try:
if os.path.isdir(dir):
testFile = os.path.join(dir, "canwrite")
Expand Down
22 changes: 7 additions & 15 deletions cmake/defaults/CXXDefaults.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
include(CXXHelpers)
include(Version)
Expand Down
22 changes: 7 additions & 15 deletions cmake/defaults/CXXHelpers.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
function(_add_define definition)
list(APPEND _PXR_CXX_DEFINITIONS "-D${definition}")
Expand Down
22 changes: 7 additions & 15 deletions cmake/defaults/Options.cmake
Original file line number Diff line number Diff line change
@@ -1,25 +1,17 @@
#
# Copyright 2016 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
# 6. Trademarks. This License does not grant permission to use the trade
# names, trademarks, service marks, or product names of the Licensor
# and its affiliates, except as required to comply with Section 4(c) of
# the License and to reproduce the content of the NOTICE file.
#
# You may obtain a copy of the Apache License at
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the Apache License with the above modification is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the Apache License for the specific
# language governing permissions and limitations under the Apache License.
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
option(PXR_STRICT_BUILD_MODE "Turn on additional warnings. Enforce all warnings as errors." OFF)
option(PXR_VALIDATE_GENERATED_CODE "Validate script generated code" OFF)
Expand Down
Loading

0 comments on commit e5e10a2

Please sign in to comment.