summaryrefslogtreecommitdiff
path: root/media-gfx/openvdb/files/openvdb-8.2.0-fix-finding-ilmbase-if-imath-and-ilmbase-are-installed.patch
blob: 88752e9fa0eb5c6445f69b698ae9290a6dc878d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Bernd Waibel <waebbl-gentoo@posteo.net>
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 <waebbl-gentoo@posteo.net>
--- 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