01_FindEmbree_so.diff 2.4 KB

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