diff --git a/CMakeLists.txt b/CMakeLists.txt index 21f361198e..9c469c1364 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -182,11 +182,34 @@ if (DEFINED MAYAUSD_TO_USD_RELATIVE_PATH) else() set(USD_INSTALL_LOCATION ${PXR_USD_LOCATION}) endif() -if (IS_WINDOWS) - configure_file("modules/mayaUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) -else() - configure_file("modules/mayaUSD.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) + + +#------------------------------------------------------------------------------ +# Maya module files +#------------------------------------------------------------------------------ +if (BUILD_ADSK_PLUGIN) + if (IS_WINDOWS) + configure_file("modules/mayaUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) + else() + configure_file("modules/mayaUSD.mod.template" ${PROJECT_BINARY_DIR}/mayaUSD.mod) + endif() + install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif() + +if (BUILD_PXR_PLUGIN) + if (IS_WINDOWS) + configure_file("modules/pxrUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod) + else() + configure_file("modules/pxrUSD.mod.template" ${PROJECT_BINARY_DIR}/pxrUSD.mod) + endif() + install(FILES ${PROJECT_BINARY_DIR}/pxrUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) +endif() + +if (BUILD_AL_PLUGIN) + if (IS_WINDOWS) + configure_file("modules/alUSD_Win.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod) + else() + configure_file("modules/alUSD.mod.template" ${PROJECT_BINARY_DIR}/alUSD.mod) + endif() + install(FILES ${PROJECT_BINARY_DIR}/alUSD.mod DESTINATION ${CMAKE_INSTALL_PREFIX}) endif() -install(FILES ${PROJECT_BINARY_DIR}/mayaUSD.mod - DESTINATION ${CMAKE_INSTALL_PREFIX} -) diff --git a/cmake/test.cmake b/cmake/test.cmake index 0d88567e25..87e5e1d6ab 100644 --- a/cmake/test.cmake +++ b/cmake/test.cmake @@ -133,14 +133,23 @@ finally: # ----------------- set(ALL_PATH_VARS - PATH PYTHONPATH MAYA_PLUG_IN_PATH MAYA_SCRIPT_PATH PXR_PLUGINPATH_NAME - LD_LIBRARY_PATH ) + if(IS_WINDOWS) + # Put path at the front of the list of env vars. + list(INSERT ALL_PATH_VARS 0 + PATH + ) + else() + list(APPEND ALL_PATH_VARS + LD_LIBRARY_PATH + ) + endif() + # Set initial empty values for all path vars foreach(pathvar ${ALL_PATH_VARS}) set(MAYAUSD_VARNAME_${pathvar}) diff --git a/modules/alUSD.mod.template b/modules/alUSD.mod.template new file mode 100644 index 0000000000..0cbda995ca --- /dev/null +++ b/modules/alUSD.mod.template @@ -0,0 +1,5 @@ ++ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al +plug-ins: plugin +PYTHONPATH+:=lib/python +PXR_PLUGINPATH_NAME+:=lib/usd +PXR_PLUGINPATH_NAME+:=plugin diff --git a/modules/alUSD_Win.mod.template b/modules/alUSD_Win.mod.template new file mode 100644 index 0000000000..f416e83bdf --- /dev/null +++ b/modules/alUSD_Win.mod.template @@ -0,0 +1,6 @@ ++ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al +plug-ins: plugin +PYTHONPATH+:=lib/python +PATH+:=lib +PXR_PLUGINPATH_NAME+:=lib/usd +PXR_PLUGINPATH_NAME+:=plugin diff --git a/modules/mayaUSD.mod.template b/modules/mayaUSD.mod.template index 00a6e2e507..fa3956a1ca 100644 --- a/modules/mayaUSD.mod.template +++ b/modules/mayaUSD.mod.template @@ -5,13 +5,7 @@ presets: scripts: resources: PYTHONPATH+:=lib/python - -+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr -icons: maya/lib/usd/usdMaya/resources -plug-ins: maya/plugin -scripts: maya/lib/usd/usdMaya/resources -PYTHONPATH+:=lib/python -PXR_PLUGINPATH_NAME+:=lib/usd +USD_LOCATION:= + MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX} icons: @@ -27,11 +21,9 @@ ${MAYAUSD_GTEST_PATH} + MayaUSD ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/adsk plug-ins: plugin -+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al -plug-ins: plugin -PYTHONPATH+:=lib/python -PXR_PLUGINPATH_NAME+:=lib/usd -PXR_PLUGINPATH_NAME+:=plugin - + MTOH ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/lib +icons: plug-ins: maya +presets: +scripts: +resources: diff --git a/modules/mayaUSD_Win.mod.template b/modules/mayaUSD_Win.mod.template index a54a5f1abb..4c22fd6e8d 100644 --- a/modules/mayaUSD_Win.mod.template +++ b/modules/mayaUSD_Win.mod.template @@ -7,14 +7,7 @@ resources: PYTHONPATH+:=lib/python PATH+:=bin PATH+:=lib - -+ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr -icons: maya/lib/usd/usdMaya/resources -plug-ins: maya/plugin -scripts: maya/lib/usd/usdMaya/resources -PYTHONPATH+:=lib/python -PATH+:=maya/lib -PXR_PLUGINPATH_NAME+:=lib/usd +USD_LOCATION:= + MayaUSD_LIB ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX} icons: @@ -31,12 +24,9 @@ ${MAYAUSD_GTEST_PATH} + MayaUSD ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/adsk plug-ins: plugin -+ AL_USDMaya ${AL_USDMAYA_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/al -plug-ins: plugin -PYTHONPATH+:=lib/python -PATH+:=lib -PXR_PLUGINPATH_NAME+:=lib/usd -PXR_PLUGINPATH_NAME+:=plugin - + MTOH ${MAYAUSD_VERSION} ${CMAKE_INSTALL_PREFIX}/lib +icons: plug-ins: maya +presets: +scripts: +resources: diff --git a/modules/pxrUSD.mod.template b/modules/pxrUSD.mod.template new file mode 100644 index 0000000000..bafc387d41 --- /dev/null +++ b/modules/pxrUSD.mod.template @@ -0,0 +1,6 @@ ++ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr +icons: maya/lib/usd/usdMaya/resources +plug-ins: maya/plugin +scripts: maya/lib/usd/usdMaya/resources +PYTHONPATH+:=lib/python +PXR_PLUGINPATH_NAME+:=lib/usd diff --git a/modules/pxrUSD_Win.mod.template b/modules/pxrUSD_Win.mod.template new file mode 100644 index 0000000000..46154a04e7 --- /dev/null +++ b/modules/pxrUSD_Win.mod.template @@ -0,0 +1,7 @@ ++ PXR_USDMAYA ${USD_VERSION} ${CMAKE_INSTALL_PREFIX}/plugin/pxr +icons: maya/lib/usd/usdMaya/resources +plug-ins: maya/plugin +scripts: maya/lib/usd/usdMaya/resources +PYTHONPATH+:=lib/python +PATH+:=maya/lib +PXR_PLUGINPATH_NAME+:=lib/usd diff --git a/test/lib/usd/pxrUsdPreviewSurface/CMakeLists.txt b/test/lib/usd/pxrUsdPreviewSurface/CMakeLists.txt index 1071b89bcf..2880563de9 100644 --- a/test/lib/usd/pxrUsdPreviewSurface/CMakeLists.txt +++ b/test/lib/usd/pxrUsdPreviewSurface/CMakeLists.txt @@ -3,9 +3,17 @@ set(TARGET_NAME MAYAUSD_NODES_TEST) # Unit test scripts. set(TEST_SCRIPT_FILES testPxrUsdPreviewSurfaceDraw.py - testPxrUsdPreviewSurfaceExport.py ) +if(BUILD_PXR_PLUGIN) + # This test uses the file "PxrUsdPreviewSurfaceExportTest.ma" which + # requires the plugin "pxrUsdPreviewSurface" that is built by the + # Pixar plugin. + list(APPEND TEST_SCRIPT_FILES + testPxrUsdPreviewSurfaceExport.py + ) +endif() + # copy tests to ${CMAKE_CURRENT_BINARY_DIR} and run them from there add_custom_target(${TARGET_NAME} ALL)