Skip to content

Commit

Permalink
Added option to install resource folder (#1419)
Browse files Browse the repository at this point in the history
Added an option in the CMake file which toggles the installation of resources if the renderer is built and the user wants to install the resources.
  • Loading branch information
Benjamin Beilharz authored Jul 23, 2023
1 parent 333ac96 commit 42e8b76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ option(MATERIALX_BUILD_TESTS "Build unit tests." ON)
option(MATERIALX_BUILD_SHARED_LIBS "Build MaterialX libraries as shared rather than static." OFF)
option(MATERIALX_PYTHON_LTO "Enable link-time optimizations for MaterialX Python." ON)
option(MATERIALX_INSTALL_PYTHON "Install the MaterialX Python package as a third-party library when the install target is built." ON)
option(MATERIALX_INSTALL_RESOURCES "Install the resources folder when building render modules." ON)
option(MATERIALX_TEST_RENDER "Run rendering tests for MaterialX Render module. GPU required for graphics validation." ON)
option(MATERIALX_WARNINGS_AS_ERRORS "Interpret all compiler warnings as errors." OFF)
option(MATERIALX_DYNAMIC_ANALYSIS "Build MaterialX libraries with dynamic analysis on supporting platforms." OFF)
Expand Down Expand Up @@ -276,7 +277,9 @@ if(MATERIALX_BUILD_RENDER)
if(MATERIALX_BUILD_GRAPH_EDITOR)
add_subdirectory(source/MaterialXGraphEditor)
endif()
add_subdirectory(resources)
if(MATERIALX_INSTALL_RESOURCES)
add_subdirectory(resources)
endif()
endif()

# Add test subdirectory
Expand Down
4 changes: 3 additions & 1 deletion cmake/modules/MaterialXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ set_and_check(MATERIALX_STDLIB_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/libraries")
if(@MATERIALX_BUILD_PYTHON@ AND @MATERIALX_INSTALL_PYTHON@)
set_and_check(MATERIALX_PYTHON_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/python")
endif()
set_and_check(MATERIALX_RESOURCES_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/resources")
if(@MATERIALX_BUILD_RENDER@ AND @MATERIALX_INSTALL_RESOURCES@)
set_and_check(MATERIALX_RESOURCES_DIR "@PACKAGE_CMAKE_INSTALL_PREFIX@/resources")
endif()

check_required_components(@CMAKE_PROJECT_NAME@)

0 comments on commit 42e8b76

Please sign in to comment.