2023-08-15 16:20:26 +02:00
|
|
|
# SPDX-FileCopyrightText: 2018 Blender Authors
|
2023-06-14 14:49:59 +02:00
|
|
|
#
|
2022-02-11 04:23:56 +01:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2018-04-24 13:26:54 +02:00
|
|
|
# - Find Blosc library
|
|
|
|
# Find the native Blosc includes and library
|
|
|
|
# This module defines
|
|
|
|
# BLOSC_INCLUDE_DIRS, where to find blosc.h, Set when
|
|
|
|
# Blosc is found.
|
|
|
|
# BLOSC_LIBRARIES, libraries to link against to use Blosc.
|
|
|
|
# BLOSC_ROOT_DIR, The base directory to search for Blosc.
|
|
|
|
# This can also be an environment variable.
|
|
|
|
# BLOSC_FOUND, If false, do not try to use Blosc.
|
|
|
|
#
|
|
|
|
# also defined, but not for general use are
|
|
|
|
# BLOSC_LIBRARY, where to find the Blosc library.
|
|
|
|
|
2023-07-29 05:47:55 +02:00
|
|
|
# If `BLOSC_ROOT_DIR` was defined in the environment, use it.
|
2023-08-17 05:15:56 +02:00
|
|
|
if(DEFINED BLOSC_ROOT_DIR)
|
2023-07-29 05:47:55 +02:00
|
|
|
# Pass.
|
2023-08-17 05:15:56 +02:00
|
|
|
elseif(DEFINED ENV{BLOSC_ROOT_DIR})
|
|
|
|
set(BLOSC_ROOT_DIR $ENV{BLOSC_ROOT_DIR})
|
|
|
|
else()
|
|
|
|
set(BLOSC_ROOT_DIR "")
|
|
|
|
endif()
|
2018-04-24 13:26:54 +02:00
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
set(_blosc_SEARCH_DIRS
|
2018-04-24 13:26:54 +02:00
|
|
|
${BLOSC_ROOT_DIR}
|
|
|
|
/opt/lib/blosc
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_path(BLOSC_INCLUDE_DIR
|
2018-04-24 13:26:54 +02:00
|
|
|
NAMES
|
|
|
|
blosc.h
|
|
|
|
HINTS
|
|
|
|
${_blosc_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(BLOSC_LIBRARY
|
2018-04-24 13:26:54 +02:00
|
|
|
NAMES
|
|
|
|
blosc
|
|
|
|
HINTS
|
|
|
|
${_blosc_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set BLOSC_FOUND to TRUE if
|
|
|
|
# all listed variables are TRUE
|
2023-08-17 05:15:56 +02:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Blosc DEFAULT_MSG
|
2018-04-24 13:26:54 +02:00
|
|
|
BLOSC_LIBRARY BLOSC_INCLUDE_DIR)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
if(BLOSC_FOUND)
|
|
|
|
set(BLOSC_LIBRARIES ${BLOSC_LIBRARY})
|
|
|
|
set(BLOSC_INCLUDE_DIRS ${BLOSC_INCLUDE_DIR})
|
|
|
|
else()
|
|
|
|
set(BLOSC_BLOSC_FOUND FALSE)
|
|
|
|
endif()
|
2018-04-24 13:26:54 +02:00
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
mark_as_advanced(
|
2018-04-24 13:26:54 +02:00
|
|
|
BLOSC_INCLUDE_DIR
|
|
|
|
BLOSC_LIBRARY
|
|
|
|
)
|
2024-03-08 00:53:03 +01:00
|
|
|
|
|
|
|
unset(_blosc_SEARCH_DIRS)
|