Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update refactoring sandbox #17

Merged
merged 25 commits into from
Aug 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
cc0df71
MAYA-99646 minor build fix (#78)
Jul 28, 2019
5bd5612
Update README.md
Jul 29, 2019
2717306
MAYA-99741 - Build all 3 plugins build/work in sandbox (#77)
seando-adsk Jul 29, 2019
a66591c
MAYA-99741 - Build all 3 plugins build/work in sandbox (#81)
seando-adsk Jul 29, 2019
c034731
MAYA-99646 Complete selection highlight support for VP2RenderDelegate…
Jul 30, 2019
aee93ad
Make 3 main branches mergeable, and unify changes (#5) (#86)
Jul 30, 2019
1c70628
Linux translator plugins (#82)
ppt-adsk Jul 31, 2019
0811aac
MAYA-99736 Fix build errors with Maya 2018 (#87)
Jul 31, 2019
b82530f
- Added support for stages in the build script. Comma-separated list …
Jul 31, 2019
3b79e1b
- Added the check for build stage that I missed in my initial commit.
Jul 31, 2019
578e24d
Revert "- Added the check for build stage that I missed in my initial…
Jul 31, 2019
ea6fd60
MAYA-99741 - Build all 3 plugins build/work in sandbox (#90)
seando-adsk Jul 31, 2019
1a92ea3
MAYA-99741 - Build all 3 plugins build/work in sandbox (#91)
seando-adsk Aug 1, 2019
29ac3fb
- trying to be explicit here for sake of clarity! (#89)
Aug 1, 2019
a6a816d
Merge pull request #92 from maya3d/sabrih/update_build_doc
Aug 2, 2019
79de90f
MAYA-99741 - Build all 3 plugins build/work in sandbox (#93)
seando-adsk Aug 2, 2019
0760ad8
Fix import (#97)
ppt-adsk Aug 6, 2019
b1c679a
Fix variant switching after merge of proxy shapes (#98)
Aug 7, 2019
f0bf0f8
Run time path improvement for MacOSX and Linux(#99)
Aug 12, 2019
9f524d4
Reference assembly cleanup (#100)
ppt-adsk Aug 12, 2019
a377b14
Fix windows build. Missing exports. (#102)
Aug 13, 2019
da9b603
mayaUsd translator import / export MEL scripts. (#101)
ppt-adsk Aug 13, 2019
335433c
Merge remote-tracking branch 'origin_luma/refactoring_sandbox' into test
Aug 15, 2019
afab045
Merge pull request #104 from maya3d/sabrih/merge_luma_refactoring_san…
Aug 15, 2019
dbb18a2
Merge branch 'refactoring_sandbox' into update_refactoring_sandbox
Aug 15, 2019
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
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ cmake_minimum_required(VERSION 3.1.1)
#==============================================================================
# Define common build variables
#==============================================================================
set(BUILD_MAYAUSD_LIBRARY ON CACHE BOOL "Build Core USD libraries.")
set(BUILD_ADSK_PLUGIN ON CACHE BOOL "Build Autodesk USD plugin.")
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.")
option(BUILD_MAYAUSD_LIBRARY "Build Core USD libraries." ON)
option(BUILD_ADSK_PLUGIN "Build Autodesk USD plugin." ON)
option(BUILD_PXR_PLUGIN "Build the Pixar USD plugin and libraries." ON)
option(BUILD_AL_PLUGIN "Build the Animal Logic USD plugin and libraries." ON)

option(CMAKE_WANT_UFE_BUILD "Enable building with UFE (if found)." ON)

#==============================================================================
# Modules and Definitions
Expand All @@ -40,7 +42,7 @@ if (BUILD_MAYAUSD_LIBRARY)
endif()

if (APPLE)
set(OSX_ARCHITECTURES "x86_64")
set(CMAKE_OSX_ARCHITECTURES "x86_64")
add_definitions(-DOSMac_ -DMAC_PLUGIN)
add_definitions(-D_BOOL -DREQUIRE_IOSTREAM)
endif()
Expand Down
4 changes: 2 additions & 2 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,11 +457,11 @@ def __init__(self, args):

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

if context.stagesArgs:
summaryMsg += """
Stages arguments {stagesArgs}"""
Stages arguments {stagesArgs}"""

summaryMsg = summaryMsg.format(
mayaUsdSrcDir=context.mayaUsdSrcDir,
Expand Down
2 changes: 1 addition & 1 deletion cmake/defaults/CXXDefaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ _add_define(GLX_GLXEXT_PROTOTYPES)
_add_define(BOOST_PYTHON_NO_PY_SIGNATURES)

# Maya seems to require this
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
if (IS_LINUX)
_add_define(LINUX)
endif()

Expand Down
14 changes: 7 additions & 7 deletions cmake/modules/FindMaya.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ macro(MAYA_SET_PLUGIN_PROPERTIES target)

set(_maya_DEFINES REQUIRE_IOSTREAM _BOOL)

if(APPLE)
if(IS_MACOSX)
set(_maya_DEFINES "${_maya_DEFINES}" MAC_PLUGIN OSMac_ OSMac_MachO)
set_target_properties(${target} PROPERTIES
PREFIX ""
Expand Down Expand Up @@ -78,15 +78,15 @@ macro(MAYA_SET_PLUGIN_PROPERTIES target)
endmacro(MAYA_SET_PLUGIN_PROPERTIES)
#=============================================================================

if(APPLE)
if(IS_MACOSX)
set(MAYA_PLUGIN_SUFFIX ".bundle")
elseif(WIN32)
elseif(IS_WINDOWS)
set(MAYA_PLUGIN_SUFFIX ".mll")
else() #LINUX
else(IS_LINUX)
set(MAYA_PLUGIN_SUFFIX ".so")
endif()

if(APPLE)
if(IS_MACOSX)
find_path(MAYA_BASE_DIR
include/maya/MFn.h
HINTS
Expand All @@ -111,7 +111,7 @@ if(APPLE)
DOC
"Maya's libraries path"
)
elseif(UNIX)
elseif(IS_LINUX)
find_path(MAYA_BASE_DIR
include/maya/MFn.h
HINTS
Expand All @@ -136,7 +136,7 @@ elseif(UNIX)
DOC
"Maya's libraries path"
)
elseif(WIN32)
elseif(IS_WINDOWS)
find_path(MAYA_BASE_DIR
include/maya/MFn.h
HINTS
Expand Down
27 changes: 23 additions & 4 deletions cmake/modules/FindMayaUSD.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# MAYAUSD_INCLUDE_DIR Path to the MAYAUSD's include directories
#

if(APPLE)
if(IS_MACOSX)
find_path(MAYAUSD_LIBRARY_DIR
libmayaUsd.dylib
HINTS
Expand All @@ -24,7 +24,7 @@ if(APPLE)
DOC
"MayaUSD's libraries path"
)
elseif(UNIX)
elseif(IS_LINUX)
find_path(MAYAUSD_LIBRARY_DIR
libmayaUsd.so
HINTS
Expand All @@ -40,7 +40,7 @@ elseif(UNIX)
DOC
"MayaUSD's libraries path"
)
elseif(WIN32)
elseif(IS_WINDOWS)
find_path(MAYAUSD_LIBRARY_DIR
mayaUsd.lib
HINTS
Expand Down Expand Up @@ -76,7 +76,7 @@ find_path(MAYAUSD_INCLUDE_DIR

# Use find_library to account for platform-specific library name prefixes
# (e.g. lib) and suffixes (e.g. .lib, .so, .dylib).
foreach(MAYAUSD_LIB mayaUsd mayaUsd_Schemas)
foreach(MAYAUSD_LIB mayaUsd)

find_library(MAYAUSD_${MAYAUSD_LIB}_LIBRARY
${MAYAUSD_LIB}
Expand All @@ -91,6 +91,23 @@ foreach(MAYAUSD_LIB mayaUsd mayaUsd_Schemas)

endforeach(MAYAUSD_LIB)

# Schema libraries are PxrPlugin plugins, but are also linked against by plugins
# providing import, export or updater behavior for the types they provide.
foreach(MAYAUSD_LIB mayaUsd_Schemas)

find_library(MAYAUSD_${MAYAUSD_LIB}_LIBRARY
${MAYAUSD_LIB}
HINTS
${MAYAUSD_LIBRARY_DIR}
NO_DEFAULT_PATH
)

if (MAYAUSD_${MAYAUSD_LIB}_LIBRARY)
list(APPEND MAYAUSD_SCHEMA_LIBRARIES ${MAYAUSD_${MAYAUSD_LIB}_LIBRARY})
endif()

endforeach(MAYAUSD_LIB)

# If we weren't passed in the MayaUsd version info, read it from the header file.
if (NOT DEFINED MAYAUSD_MAJOR_VERSION)
file(READ ${MAYAUSD_INCLUDE_DIR}/mayaUsd/mayaUsd.h MAYAUSD_MAIN_HEADER)
Expand All @@ -102,6 +119,7 @@ set(MAYAUSD_VERSION "${MAYAUSD_MAJOR_VERSION}.${MAYAUSD_MINOR_VERSION}.${MAYAUSD

message(STATUS "MayaUSD include dir: ${MAYAUSD_INCLUDE_DIR}")
message(STATUS "MayaUSD libraries: ${MAYAUSD_LIBRARIES}")
message(STATUS "MayaUSD schema libraries: ${MAYAUSD_SCHEMA_LIBRARIES}")
message(STATUS "MayaUSD version: ${MAYAUSD_VERSION}")

# handle the QUIETLY and REQUIRED arguments and set MAYAUSD_FOUND to TRUE if
Expand All @@ -112,6 +130,7 @@ find_package_handle_standard_args(MAYAUSD
REQUIRED_VARS
MAYAUSD_INCLUDE_DIR
MAYAUSD_LIBRARIES
MAYAUSD_SCHEMA_LIBRARIES
VERSION_VAR
MAYAUSD_VERSION
)
11 changes: 7 additions & 4 deletions cmake/modules/FindUFE.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ find_library(UFE_LIBRARY
NO_DEFAULT_PATH
)

message(STATUS "UFE include dir: ${UFE_INCLUDE_DIR}")
message(STATUS "UFE library: ${UFE_LIBRARY}")
message(STATUS "UFE version: ${UFE_VERSION}")

# Handle the QUIETLY and REQUIRED arguments and set UFE_FOUND to TRUE if
# all listed variables are TRUE.
include(FindPackageHandleStandardArgs)
Expand All @@ -77,5 +73,12 @@ find_package_handle_standard_args(UFE
REQUIRED_VARS
UFE_INCLUDE_DIR
UFE_LIBRARY
VERSION_VAR
UFE_VERSION
)

if(UFE_FOUND)
message(STATUS "UFE include dir: ${UFE_INCLUDE_DIR}")
message(STATUS "UFE library: ${UFE_LIBRARY}")
message(STATUS "UFE version: ${UFE_VERSION}")
endif()
109 changes: 92 additions & 17 deletions cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
# =======================================================================
#

# The name of the operating system for which CMake is to build
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(IS_WINDOWS TRUE)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(IS_LINUX TRUE)
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(IS_MACOSX TRUE)
endif()

# Appends a path to an environment variable.
# Note: if you want to append multiple paths either call this multiple
# times, or send in the paths with the proper platform separator.
Expand All @@ -26,7 +35,7 @@
function(append_path_to_env_var envVar pathToAppend)
file(TO_NATIVE_PATH "${pathToAppend}" nativePathToAppend)
if(DEFINED ENV{${envVar}})
if(WIN32)
if(IS_WINDOWS)
set(newPath "$ENV{${envVar}};${nativePathToAppend}")
else()
set(newPath "$ENV{${envVar}}:${nativePathToAppend}")
Expand All @@ -44,20 +53,86 @@ endfunction()
# module The python module to find
#
function(find_python_module module)
string(TOUPPER ${module} module_upper)
set(module_found "${module_upper}_FOUND")
if(NOT ${module_found})
if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
set(${module}_FIND_REQUIRED TRUE)
endif()
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)"
RESULT_VARIABLE _${module}_status
OUTPUT_VARIABLE _${module}_location
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _${module}_status)
set(${module_found} ${_${module}_location} CACHE STRING
"Location of Python module ${module}")
endif(NOT _${module}_status)
endif(NOT ${module_found})
string(TOUPPER ${module} module_upper)
set(module_found "${module_upper}_FOUND")
if(NOT ${module_found})
if(ARGC GREATER 1 AND ARGV1 STREQUAL "REQUIRED")
set(${module}_FIND_REQUIRED TRUE)
endif()
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
"import re, ${module}; print re.compile('/__init__.py.*').sub('',${module}.__file__)"
RESULT_VARIABLE _${module}_status
OUTPUT_VARIABLE _${module}_location
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _${module}_status)
set(${module_found} ${_${module}_location} CACHE STRING
"Location of Python module ${module}")
endif(NOT _${module}_status)
endif(NOT ${module_found})
endfunction(find_python_module)

# Initialize a variable to accumulate an rpath. The origin is the
# RUNTIME DESTINATION of the target. If not absolute it's appended
# to CMAKE_INSTALL_PREFIX.
function(init_rpath rpathRef origin)
if(NOT IS_ABSOLUTE ${origin})
set(origin "${CMAKE_INSTALL_PREFIX}/${INSTALL_DIR_SUFFIX}/${origin}")
get_filename_component(origin "${origin}" REALPATH)
endif()
set(${rpathRef} "${origin}" PARENT_SCOPE)
endfunction()

# Add a relative target path to the rpath. If target is absolute compute
# and add a relative path from the origin to the target.
function(add_rpath rpathRef target)
if(IS_ABSOLUTE "${target}")
# Make target relative to $ORIGIN (which is the first element in
# rpath when initialized with _pxr_init_rpath()).
list(GET ${rpathRef} 0 origin)
file(RELATIVE_PATH
target
"${origin}"
"${target}"
)
if("x${target}" STREQUAL "x")
set(target ".")
endif()
endif()
file(TO_CMAKE_PATH "${target}" target)
set(new_rpath "${${rpathRef}}")
list(APPEND new_rpath "$ORIGIN/${target}")
set(${rpathRef} "${new_rpath}" PARENT_SCOPE)
endfunction()

function(install_rpath rpathRef NAME)
# Get and remove the origin.
list(GET ${rpathRef} 0 origin)
set(rpath ${${rpathRef}})
list(REMOVE_AT rpath 0)

# Canonicalize and uniquify paths.
set(final "")
foreach(path ${rpath})
# Replace $ORIGIN with @loader_path
if(IS_MACOSX)
if("${path}/" MATCHES "^[$]ORIGIN/")
# Replace with origin path.
string(REPLACE "$ORIGIN/" "@loader_path/" path "${path}/")
endif()
endif()

# Strip trailing slashes.
string(REGEX REPLACE "/+$" "" path "${path}")

# Ignore paths we already have.
if (NOT ";${final};" MATCHES ";${path};")
list(APPEND final "${path}")
endif()
endforeach()

set_target_properties(${NAME}
PROPERTIES
INSTALL_RPATH_USE_LINK_PATH TRUE
INSTALL_RPATH "${final}"
)
endfunction()
Loading