summaryrefslogtreecommitdiffstats
path: root/graphics/Blender/01_FindEmbree_so.diff
blob: 6739f6852a827a786d4e0e9fd2992cc29355fdaa (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
--- build_files/cmake/Modules/FindEmbree.cmake.orig	2020-10-21 18:59:19.000000000 +1000
+++ build_files/cmake/Modules/FindEmbree.cmake	2021-01-16 01:26:51.000000000 +1000
@@ -7,19 +7,12 @@
 #  EMBREE_ROOT_DIR, The base directory to search for Embree.
 #                        This can also be an environment variable.
 #  EMBREEFOUND, If false, do not try to use Embree.
-#
-# also defined, but not for general use are
-#  EMBREE_LIBRARY, where to find the Embree library.
 
 #=============================================================================
 # Copyright 2018 Blender Foundation.
 #
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
+# Distributed under the OSI-approved BSD 3-Clause License,
+# see accompanying file BSD-3-Clause-license.txt for details.
 #=============================================================================
 
 # If EMBREE_ROOT_DIR was defined in the environment, use it.
@@ -44,9 +37,9 @@
 
 SET(_embree_FIND_COMPONENTS
   embree3
+  embree_sse42
   embree_avx
   embree_avx2
-  embree_sse42
   lexers
   math
   simd
@@ -66,29 +59,28 @@
     PATH_SUFFIXES
       lib64 lib
     )
+  IF (NOT EMBREE_${UPPERCOMPONENT}_LIBRARY)
+    IF (EMBREE_EMBREE3_LIBRARY)
+      # If we can't find all the static libraries, try to fall back to the shared library if found.
+      # This allows building with a shared embree library
+      SET(_embree_LIBRARIES ${EMBREE_EMBREE3_LIBRARY})
+      BREAK()
+    ENDIF ()
+  ENDIF ()
   LIST(APPEND _embree_LIBRARIES "${EMBREE_${UPPERCOMPONENT}_LIBRARY}")
 ENDFOREACH()
 
 
-FIND_LIBRARY(EMBREE_LIBRARY
-  NAMES
-    libembree3
-  HINTS
-    ${_embree_SEARCH_DIRS}
-  PATH_SUFFIXES
-    lib64 lib
-)
-
 # handle the QUIETLY and REQUIRED arguments and set EMBREE_FOUND to TRUE if
 # all listed variables are TRUE
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(EMBREE DEFAULT_MSG
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Embree DEFAULT_MSG
     _embree_LIBRARIES EMBREE_INCLUDE_DIR)
 
 IF(EMBREE_FOUND)
   SET(EMBREE_LIBRARIES ${_embree_LIBRARIES})
   SET(EMBREE_INCLUDE_DIRS ${EMBREE_INCLUDE_DIR})
-ENDIF(EMBREE_FOUND)
+ENDIF()
 
 MARK_AS_ADVANCED(
   EMBREE_INCLUDE_DIR