diff options
author | tamasmeszaros <meszaros.q@gmail.com> | 2021-07-14 17:26:44 +0300 |
---|---|---|
committer | tamasmeszaros <meszaros.q@gmail.com> | 2021-07-15 10:36:28 +0300 |
commit | e6507594fb6893156056c2123822a2b37f7f179d (patch) | |
tree | 7bfae1c0e3bd84e7f550533c952f3a0aff0dfb9c /cmake | |
parent | 062031a4c6a9fa4d941955f9547e416055f65c02 (diff) |
Search for a better openvdb find module if available
Solves #6681, alternative path for openvdb installation can be specified via cache variable
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindOpenVDB.cmake | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmake/modules/FindOpenVDB.cmake b/cmake/modules/FindOpenVDB.cmake index 02420fed8..3b60ac9d3 100644 --- a/cmake/modules/FindOpenVDB.cmake +++ b/cmake/modules/FindOpenVDB.cmake @@ -102,6 +102,27 @@ may be provided to tell this module where to look. #]=======================================================================] +# If an explicit openvdb module path was specified, that will be used +if (OPENVDB_FIND_MODULE_PATH) + set(_module_path_bak ${CMAKE_MODULE_PATH}) + set(CMAKE_MODULE_PATH ${OPENVDB_FIND_MODULE_PATH}) + find_package( + OpenVDB ${OpenVDB_FIND_VERSION} QUIET + COMPONENTS + ${OpenVDB_FIND_COMPONENTS} + ) + + set(CMAKE_MODULE_PATH ${_module_path_bak}) + if (OpenVDB_FOUND) + return() + endif () + + if (NOT OpenVDB_FIND_QUIETLY) + message(STATUS "Using bundled find module for OpenVDB") + endif () +endif () +# ########################################################################### + cmake_minimum_required(VERSION 3.3) # Monitoring <PackageName>_ROOT variables if(POLICY CMP0074) |