diff --git a/cmake/DetectOptions.cmake b/cmake/DetectOptions.cmake index d66e096bda..c46bb9849c 100644 --- a/cmake/DetectOptions.cmake +++ b/cmake/DetectOptions.cmake @@ -73,15 +73,15 @@ find_package(Threads REQUIRED) # Blosc2 if(ADIOS2_USE_Blosc2 STREQUAL AUTO) # Prefect CONFIG mode - find_package(Blosc2 2.4 CONFIG QUIET) + find_package(Blosc2 2.10.2 CONFIG QUIET) if(NOT Blosc2_FOUND) - find_package(Blosc2 2.4 MODULE QUIET) + find_package(Blosc2 2.10.2 MODULE QUIET) endif() elseif(ADIOS2_USE_Blosc2) # Prefect CONFIG mode - find_package(Blosc2 2.4 CONFIG) + find_package(Blosc2 2.10.2 CONFIG) if(NOT Blosc2_FOUND) - find_package(Blosc2 2.4 MODULE REQUIRED) + find_package(Blosc2 2.10.2 MODULE REQUIRED) endif() endif() if(Blosc2_FOUND) @@ -91,12 +91,10 @@ if(Blosc2_FOUND) endif() set(adios2_blosc2_tgt Blosc2::Blosc2) - if (Blosc2_VERSION VERSION_GREATER_EQUAL 2.10.1) - if (Blosc2_shlib_available) - set(adios2_blosc2_tgt Blosc2::blosc2_$,shared,static>) - else() - set(adios2_blosc2_tgt Blosc2::blosc2_static) - endif() + if (Blosc2_shlib_available) + set(adios2_blosc2_tgt Blosc2::blosc2_$,shared,static>) + else() + set(adios2_blosc2_tgt Blosc2::blosc2_static) endif() add_library(adios2_blosc2 INTERFACE) diff --git a/cmake/FindBlosc2.cmake b/cmake/FindBlosc2.cmake deleted file mode 100644 index 10762297cc..0000000000 --- a/cmake/FindBlosc2.cmake +++ /dev/null @@ -1,91 +0,0 @@ -#------------------------------------------------------------------------------# -# Distributed under the OSI-approved Apache License, Version 2.0. See -# accompanying file Copyright.txt for details. -#------------------------------------------------------------------------------# -# -# FindBLOSC22 -# ----------- -# -# Try to find the BLOSC2 library -# -# This module defines the following variables: -# -# BLOSC2_FOUND - System has BLOSC2 -# BLOSC2_INCLUDE_DIRS - The BLOSC2 include directory -# BLOSC2_LIBRARIES - Link these to use BLOSC2 -# BLOSC2_VERSION - Version of the BLOSC2 library to support -# -# and the following imported targets: -# Blosc2::Blosc2 - The core BLOSC2 library -# -# You can also set the following variable to help guide the search: -# BLOSC2_ROOT - The install prefix for BLOSC2 containing the -# include and lib folders -# Note: this can be set as a CMake variable or an -# environment variable. If specified as a CMake -# variable, it will override any setting specified -# as an environment variable. - -if(NOT BLOSC2_FOUND) - if((NOT BLOSC2_ROOT) AND (DEFINED ENV{BLOSC2_ROOT})) - set(BLOSC2_ROOT "$ENV{BLOSC2_ROOT}") - endif() - if(BLOSC2_ROOT) - set(BLOSC2_INCLUDE_OPTS HINTS ${BLOSC2_ROOT}/include NO_DEFAULT_PATHS) - set(BLOSC2_LIBRARY_OPTS - HINTS ${BLOSC2_ROOT}/lib ${BLOSC2_ROOT}/lib64 - NO_DEFAULT_PATHS - ) - endif() - if(WIN32) # uses a Unix-like library prefix on Windows - set(BLOSC2_LIBRARY_OPTS - libblosc2 ${BLOSC2_LIBRARY_OPTS} - ) - endif() - - find_path(BLOSC2_INCLUDE_DIR blosc2.h ${BLOSC2_INCLUDE_OPTS}) - find_library(BLOSC2_LIBRARY NAMES blosc2 ${BLOSC2_LIBRARY_OPTS}) - if(BLOSC2_INCLUDE_DIR) - file(STRINGS ${BLOSC2_INCLUDE_DIR}/blosc2.h _ver_string - REGEX [=[BLOSC2_VERSION_STRING +"[^"]*"]=] - ) - if(_ver_string MATCHES [=[BLOSC2_VERSION_STRING +"([0-9]+.[0-9]+.[0-9]+)]=]) - set(BLOSC2_VERSION ${CMAKE_MATCH_1}) - endif() - endif() - - # Blosc2 depends on pthreads - set(THREADS_PREFER_PTHREAD_FLAG TRUE) - if(WIN32) - # try to use the system library - find_package(Threads) - if(NOT Threads_FOUND) - message(STATUS "Blosc2: used the internal pthread library for win32 systems.") - set(BLOSC2_LIBRARIES) - else() - set(BLOSC2_LIBRARIES Threads::Threads) - endif() - else() - find_package(Threads REQUIRED) - set(BLOSC2_LIBRARIES Threads::Threads) - endif() - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Blosc2 - FOUND_VAR BLOSC2_FOUND - VERSION_VAR BLOSC2_VERSION - REQUIRED_VARS BLOSC2_LIBRARY BLOSC2_INCLUDE_DIR - ) - if(BLOSC2_FOUND) - set(BLOSC2_INCLUDE_DIRS ${BLOSC2_INCLUDE_DIR}) - set(BLOSC2_LIBRARIES ${BLOSC2_LIBRARY}) - if(BLOSC2_FOUND AND NOT TARGET Blosc2::Blosc2) - add_library(Blosc2::Blosc2 UNKNOWN IMPORTED) - set_target_properties(Blosc2::Blosc2 PROPERTIES - IMPORTED_LOCATION "${BLOSC2_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${BLOSC2_INCLUDE_DIR}" - INTERFACE_LINK_LIBRARIES "${BLOSC2_LIBRARIES}" - ) - endif() - endif() -endif()