forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
20 lines (15 loc) · 858 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
set(SETUP_PY_IN "${CMAKE_CURRENT_SOURCE_DIR}/setup.py.in")
set(SETUP_PY "${CMAKE_INSTALL_PREFIX}/python/setup.py")
configure_file(${SETUP_PY_IN} ${SETUP_PY})
add_custom_command(OUTPUT ${SETUP_PY}
COMMAND ${PYTHON} ${SETUP_PY} build)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/MaterialX" DESTINATION "${CMAKE_INSTALL_PREFIX}/python" MESSAGE_NEVER)
if(MATERIALX_PYTHON_OCIO_DIR)
if(NOT EXISTS "${MATERIALX_PYTHON_OCIO_DIR}/config.ocio")
message(WARNING "No file named config.ocio was found in the given OCIO directory.")
endif()
install(DIRECTORY "${MATERIALX_PYTHON_OCIO_DIR}/" DESTINATION "${CMAKE_INSTALL_PREFIX}/python/MaterialX/config/" MESSAGE_NEVER)
endif()
if(MATERIALX_INSTALL_PYTHON AND PYTHON_EXECUTABLE)
install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} ${SETUP_PY} install)" MESSAGE_NEVER)
endif()