FindBlosc.cmake 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # - Find Blosc library
  2. # Find the native Blosc includes and library
  3. # This module defines
  4. # BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
  5. # Blosc is found.
  6. # BLOSC_LIBRARIES, libraries to link against to use Blosc.
  7. # BLOSC_ROOT_DIR, The base directory to search for Blosc.
  8. # This can also be an environment variable.
  9. # BLOSC_FOUND, If false, do not try to use Blosc.
  10. #
  11. # also defined, but not for general use are
  12. # BLOSC_LIBRARY, where to find the Blosc library.
  13. #=============================================================================
  14. # Copyright 2018 Blender Foundation.
  15. #
  16. # Distributed under the OSI-approved BSD License (the "License");
  17. # see accompanying file Copyright.txt for details.
  18. #
  19. # This software is distributed WITHOUT ANY WARRANTY; without even the
  20. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  21. # See the License for more information.
  22. #=============================================================================
  23. # If BLOSC_ROOT_DIR was defined in the environment, use it.
  24. IF(NOT BLOSC_ROOT_DIR AND NOT $ENV{BLOSC_ROOT_DIR} STREQUAL "")
  25. SET(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
  26. ENDIF()
  27. SET(_blosc_SEARCH_DIRS
  28. ${BLOSC_ROOT_DIR}
  29. /usr/local
  30. /sw # Fink
  31. /opt/local # DarwinPorts
  32. /opt/lib/blosc
  33. )
  34. FIND_PATH(BLOSC_INCLUDE_DIR
  35. NAMES
  36. blosc.h
  37. HINTS
  38. ${_blosc_SEARCH_DIRS}
  39. PATH_SUFFIXES
  40. include
  41. )
  42. FIND_LIBRARY(BLOSC_LIBRARY
  43. NAMES
  44. blosc
  45. HINTS
  46. ${_blosc_SEARCH_DIRS}
  47. PATH_SUFFIXES
  48. lib64 lib
  49. )
  50. # handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
  51. # all listed variables are TRUE
  52. INCLUDE(FindPackageHandleStandardArgs)
  53. FIND_PACKAGE_HANDLE_STANDARD_ARGS(BLOSC DEFAULT_MSG
  54. BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
  55. IF(BLOSC_FOUND)
  56. SET(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
  57. SET(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
  58. ELSE()
  59. SET(BLOSC_BLOSC_FOUND FALSE)
  60. ENDIF()
  61. MARK_AS_ADVANCED(
  62. BLOSC_INCLUDE_DIR
  63. BLOSC_LIBRARY
  64. )