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

Boudrey/maya 114428/mayapy #1787

Merged
merged 7 commits into from
Oct 28, 2021
Merged
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ set(CMAKE_MODULE_PATH
)

# Use RUNPATH instead of RPATH for all shared libs, executables and modules on Linux
if(IS_LINUX)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it ever worked, but it was a good intention and didn't seems to affect the build.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably didn't. The var "IS_LINUX" is set from utils.cmake which isn't included until line 99 below.

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") # IS_LINUX not yet defined
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-new-dtags")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-new-dtags")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--enable-new-dtags")
Expand Down
18 changes: 14 additions & 4 deletions cmake/test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ except Exception:\\n\
\")")
set(COMMAND_CALL ${MAYA_EXECUTABLE} -c ${MEL_PY_EXEC_COMMAND})
else()
set(COMMAND_CALL ${MAYA_PY_EXECUTABLE} ${PREFIX_PYTHON_SCRIPT})
seando-adsk marked this conversation as resolved.
Show resolved Hide resolved
set(SCRIPT ${CMAKE_BINARY_DIR}/test/Temporary/scripts/${test_name}.py)
FILE(WRITE ${SCRIPT} "${PREFIX_PYTHON_SCRIPT}")
set(COMMAND_CALL ${MAYA_PY_EXECUTABLE} ${SCRIPT})
endif()
else()
set(COMMAND_CALL ${PREFIX_COMMAND})
Expand All @@ -168,9 +170,9 @@ finally:
)
endif()

string(REPLACE ";" "\;" PYTEST_CODE "${PYTEST_CODE}")
set(COMMAND_CALL ${MAYA_PY_EXECUTABLE} -c "${PYTEST_CODE}")

set(SCRIPT ${CMAKE_BINARY_DIR}/test/Temporary/scripts/${test_name}.py)
FILE(WRITE ${SCRIPT} "${PYTEST_CODE}")
set(COMMAND_CALL ${MAYA_PY_EXECUTABLE} ${SCRIPT})
endif()

add_test(
Expand Down Expand Up @@ -208,6 +210,7 @@ finally:

if(IS_WINDOWS)
list(APPEND MAYAUSD_VARNAME_PATH "${CMAKE_INSTALL_PREFIX}/lib/gtest")
list(APPEND MAYAUSD_VARNAME_PATH "${MAYA_LOCATION}/bin")
seando-adsk marked this conversation as resolved.
Show resolved Hide resolved
endif()

# NOTE - we prefix varnames with "MAYAUSD_VARNAME_" just to make collision
Expand Down Expand Up @@ -363,6 +366,13 @@ finally:
# to function correctly. Has no effect when not running remote.
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
"MAYA_ALLOW_OPENGL_REMOTE_SESSION=1")

# Don't want popup when color management fails.
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
"MAYA_CM_DISABLE_ERROR_POPUPS=1")
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
"MAYA_COLOR_MGT_NO_LOGGING=1")

else()
set_property(TEST "${test_name}" APPEND PROPERTY ENVIRONMENT
"MAYA_IGNORE_DIALOGS=1")
Expand Down
5 changes: 5 additions & 0 deletions plugin/al/schemas/AL/usd/schemas/maya/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ if(IS_MACOSX OR IS_LINUX)
mayaUsd_install_rpath(rpath ${TARGET_NAME})
endif()

if(IS_MACOSX)
# Create symbolic link to python framework
file(CREATE_LINK ${MAYA_LOCATION}/Frameworks ${CMAKE_CURRENT_BINARY_DIR}/../Frameworks SYMBOLIC)
endif()

# unit tests

mayaUsd_add_test(${TARGET_NAME}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ target_link_libraries(${USDTRANSACTION_TEST_EXECUTABLE_NAME}
${PTHREAD_LINK}
)

if(IS_MACOSX)
# Create symbolic link to python framework
file(CREATE_LINK ${MAYA_LOCATION}/Frameworks ${CMAKE_CURRENT_BINARY_DIR}/../Frameworks SYMBOLIC)
endif()

target_include_directories(${USDTRANSACTION_TEST_EXECUTABLE_NAME}
PRIVATE
${GTEST_INCLUDE_DIRS}
Expand Down
1 change: 1 addition & 0 deletions test/lib/usd/translators/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ if (MAYA_APP_VERSION VERSION_GREATER_EQUAL 2020)
"MAYA_PLUG_IN_PATH=${CMAKE_CURRENT_BINARY_DIR}/../plugin"
"${PXR_OVERRIDE_PLUGINPATH_NAME}=${CMAKE_CURRENT_BINARY_DIR}/../plugin/${plugin_type}"
"INPUT_PATH=${CMAKE_CURRENT_SOURCE_DIR}"
"PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}"
)
set_property(TEST ${target} APPEND PROPERTY LABELS translators)
endforeach()
Expand Down
5 changes: 5 additions & 0 deletions test/lib/usd/utils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ target_link_libraries(${TARGET_NAME}
mayaUsdUtils
)

if(IS_MACOSX)
# Create symbolic link to python framework
file(CREATE_LINK ${MAYA_LOCATION}/Frameworks ${CMAKE_CURRENT_BINARY_DIR}/../Frameworks SYMBOLIC)
endif()

# -----------------------------------------------------------------------------
# unit tests
# -----------------------------------------------------------------------------
Expand Down