From 9d3fe0d0e2dcb2e058e341268748e92bc139744f Mon Sep 17 00:00:00 2001 From: David Lanier Date: Wed, 7 Feb 2024 11:42:40 +0100 Subject: [PATCH] HYDRA-859 : Fix MAYAUSD_MOD_PATH not being part od the downloaded MayaUsd cuts. --- cmake/modules/FindMayaUsd.cmake | 3 ++- cmake/test.cmake | 28 +++++++++++++++------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cmake/modules/FindMayaUsd.cmake b/cmake/modules/FindMayaUsd.cmake index bd07afb833..db6aec40e0 100644 --- a/cmake/modules/FindMayaUsd.cmake +++ b/cmake/modules/FindMayaUsd.cmake @@ -50,7 +50,8 @@ find_package_handle_standard_args(MayaUsd REQUIRED_VARS MAYAUSD_INCLUDE_DIR MAYAUSDAPI_LIBRARY - MAYAUSD_MOD_PATH + #MAYAUSD_MOD_PATH is not part of MayaUsd cuts downloaded so remove it from the requirements + # as we want to be able to build with MayaUsd cuts. ) if(MayaUsd_FOUND) diff --git a/cmake/test.cmake b/cmake/test.cmake index 9a6e633683..495ec1ffac 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -1,20 +1,22 @@ set(MAYA_USD_DIR ${CMAKE_CURRENT_SOURCE_DIR}) if(MayaUsd_FOUND) - #Add MAYAUSD_MOD_PATH (the path where maya USD .mod file is) to the MAYA_MODULE_PATH - # Get the current value of the environment variable - set(CURRENT_MAYA_MODULE_PATH $ENV{MAYA_MODULE_PATH}) - # Append the new path to the current value - if(IS_MACOSX OR IS_LINUX) - #Linux and OSX - set(MAYA_MODULE_PATH "${CURRENT_MAYA_MODULE_PATH}:${MAYAUSD_MOD_PATH}") - else() - #Windows - set(MAYA_MODULE_PATH "${CURRENT_MAYA_MODULE_PATH}\;${MAYAUSD_MOD_PATH}") + if (MAYAUSD_MOD_PATH) + #Add MAYAUSD_MOD_PATH (the path where maya USD .mod file is) to the MAYA_MODULE_PATH + # Get the current value of the environment variable + set(CURRENT_MAYA_MODULE_PATH $ENV{MAYA_MODULE_PATH}) + # Append the new path to the current value + if(IS_MACOSX OR IS_LINUX) + #Linux and OSX + set(MAYA_MODULE_PATH "${CURRENT_MAYA_MODULE_PATH}:${MAYAUSD_MOD_PATH}") + else() + #Windows + set(MAYA_MODULE_PATH "${CURRENT_MAYA_MODULE_PATH}\;${MAYAUSD_MOD_PATH}") + endif() + # Export the new value to the environment + set(ENV{MAYA_MODULE_PATH} ${MAYA_MODULE_PATH}) + message(STATUS "MAYA_MODULE_PATH is now : ${MAYA_MODULE_PATH}") endif() - # Export the new value to the environment - set(ENV{MAYA_MODULE_PATH} ${MAYA_MODULE_PATH}) - message(STATUS "MAYA_MODULE_PATH is now : ${MAYA_MODULE_PATH}") endif() function(mayaUsd_get_unittest_target unittest_target unittest_basename)