From a34ef0ec026ae23de5e5439f7d1b0fff13a84386 Mon Sep 17 00:00:00 2001 From: jasonliu-- Date: Tue, 18 Jul 2023 14:09:50 -0400 Subject: [PATCH] Make installing CMake module files depend on whether each specific option is turned on. Signed-off-by: jasonliu-- --- CMakeLists.txt | 43 ++++++++++++++++++++++++++++++++++--------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f25b3a049..ee9510ad0c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,19 +285,44 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake") if(OPENVDB_INSTALL_CMAKE_MODULES) set(OPENVDB_CMAKE_MODULES - cmake/FindBlosc.cmake - cmake/FindJemalloc.cmake - cmake/FindIlmBase.cmake - cmake/FindLog4cplus.cmake - cmake/FindOpenEXR.cmake cmake/FindOpenVDB.cmake cmake/FindTBB.cmake cmake/OpenVDBGLFW3Setup.cmake - cmake/OpenVDBHoudiniSetup.cmake - cmake/OpenVDBMayaSetup.cmake - cmake/OpenVDBUtils.cmake ) - install(FILES ${OPENVDB_CMAKE_MODULES} DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenVDB) + + if(USE_BLOSC) + list(APPEND OPENVDB_CMAKE_MODULES cmake/FindBlosc.cmake) + endif() + + if(CONCURRENT_MALLOC STREQUAL "Jemalloc") + list(APPEND OPENVDB_CMAKE_MODULES cmake/FindJemalloc.cmake) + endif() + + if(USE_EXR) + list(APPEND OPENVDB_CMAKE_MODULES + cmake/FindIlmBase.cmake + cmake/FindOpenEXR.cmake + ) + endif() + + if(USE_LOG4CPLUS) + list(APPEND OPENVDB_CMAKE_MODULES cmake/FindLog4cplus.cmake) + endif() + + if(USE_HOUDINI) + list(APPEND OPENVDB_CMAKE_MODULES cmake/OpenVDBHoudiniSetup.cmake) + endif() + + if(USE_MAYA) + list(APPEND OPENVDB_CMAKE_MODULES cmake/OpenVDBMayaSetup.cmake) + endif() + + if(OPENVDB_BUILD_BINARIES) + list(APPEND OPENVDB_CMAKE_MODULES cmake/OpenVDBUtils.cmake) + endif() + + install(FILES ${OPENVDB_CMAKE_MODULES} + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/OpenVDB) endif() # Configure component dependencies by loading the Houdini/Maya setup