Skip to content

Commit d1e0d2d

Browse files
authored
Run pip install at end of MaterialX install (#2853)
Relocating the pip install at the end. This allows any customizations to be included in the install. In our fork of MaterialX we install additional libraries https://github.com/autodesk-forks/MaterialX/blob/4c20cc3426812b1a196176f0a13ade2f34a36751/CMakeLists.txt#L132 https://github.com/autodesk-forks/MaterialX/blob/4c20cc3426812b1a196176f0a13ade2f34a36751/CMakeLists.txt#L620 This allows us to keep our fork in-line with main. I would to like to install additional libraries from our fork before pip install is run. Relocating the pip install at the end, avoids the amount of patches we have to keep against main.
1 parent 164768f commit d1e0d2d

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,3 +698,8 @@ if(NOT SKBUILD)
698698
"${PROJECT_BINARY_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake"
699699
DESTINATION "${MATERIALX_GEN_CONFIG_PATH}")
700700
endif()
701+
702+
# Run pip install after all install steps
703+
if(MATERIALX_BUILD_PYTHON AND MATERIALX_INSTALL_PYTHON AND PYTHON_EXECUTABLE AND NOT SKBUILD)
704+
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/python)")
705+
endif()

python/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,4 @@ endif()
1414
if(MATERIALX_INSTALL_PYTHON AND PYTHON_EXECUTABLE AND NOT SKBUILD)
1515
set(PYPROJECT_TOML "${CMAKE_INSTALL_PREFIX}/python/pyproject.toml")
1616
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyproject.toml.in" "${PYPROJECT_TOML}")
17-
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pip install . WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/python)")
1817
endif()

0 commit comments

Comments
 (0)