From: Bernd Waibel Date: Sat, 4 Dec 2021 20:16:42 +0100 Subject: [PATCH] fix finding ilmbase if imath and ilmbase are installed If both, ilmbase-2.5 and imath-3 are installed, the configuration fails if OPENVDB_BUILD_BINARIES and OPENVDB_BUILD_RENDER are set. The patch adds an additional guard based on the USE_IMATH_HALF option being set and thus decide whether to search for and use imath or ilmbase. Signed-off-by: Bernd Waibel --- a/openvdb/openvdb/cmd/CMakeLists.txt +++ b/openvdb/openvdb/cmd/CMakeLists.txt @@ -81,12 +81,17 @@ endif() #### vdb_render if(OPENVDB_BUILD_VDB_RENDER) - find_package(Imath CONFIG) - if (NOT TARGET Imath::Imath) + if(USE_IMATH_HALF) + find_package(Imath CONFIG) + if (NOT TARGET Imath::Imath) + find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath) + find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf) + else() + find_package(OpenEXR CONFIG) + endif() + else() find_package(IlmBase ${MINIMUM_ILMBASE_VERSION} REQUIRED COMPONENTS Half Iex IlmThread Imath) find_package(OpenEXR ${MINIMUM_OPENEXR_VERSION} REQUIRED COMPONENTS IlmImf) - else() - find_package(OpenEXR CONFIG) endif() set(VDB_RENDER_SOURCE_FILES openvdb_render.cc) -- 2.34.1