Skip to content

Commit

Permalink
blosc2: fix static dependency in installed cmake files
Browse files Browse the repository at this point in the history
  • Loading branch information
vicentebolea committed Mar 13, 2024
1 parent 0b3d48e commit 3a12b46
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 109 deletions.
31 changes: 13 additions & 18 deletions cmake/DetectOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,26 @@ find_package(Threads REQUIRED)

# Blosc2
if(ADIOS2_USE_Blosc2 STREQUAL AUTO)
# Prefect CONFIG mode
find_package(Blosc2 2.4 CONFIG QUIET)
if(NOT Blosc2_FOUND)
find_package(Blosc2 2.4 MODULE QUIET)
endif()
find_package(Blosc2 2.10.1 CONFIG QUIET)
elseif(ADIOS2_USE_Blosc2)
# Prefect CONFIG mode
find_package(Blosc2 2.4 CONFIG)
if(NOT Blosc2_FOUND)
find_package(Blosc2 2.4 MODULE REQUIRED)
endif()
find_package(Blosc2 2.10.1 CONFIG)
endif()
if(Blosc2_FOUND)
set(ADIOS2_HAVE_Blosc2 TRUE)
if(TARGET Blosc2::blosc2_shared)
set(Blosc2_shlib_available ON)
set(blosc2_shlib_available ON)
endif()

set(adios2_blosc2_tgt Blosc2::Blosc2)
if (Blosc2_VERSION VERSION_GREATER_EQUAL 2.10.1)
if (Blosc2_shlib_available AND ADIOS2_Blosc2_PREFER_SHARED)
set(adios2_blosc2_tgt Blosc2::blosc2_shared)
else()
set(adios2_blosc2_tgt Blosc2::blosc2_static)
endif()
if(TARGET Blosc2::blosc2_static)
set(blosc2_slib_available ON)
endif()

if (blosc2_shlib_available AND (NOT blosc2_slib_available OR ADIOS2_Blosc2_PREFER_SHARED))
set(adios2_blosc2_tgt Blosc2::blosc2_shared)
elseif(blosc2_slib_available)
set(adios2_blosc2_tgt Blosc2::blosc2_static)
else()
message(FATAL_ERROR "Blosc2 cmake package found but no targets exists inside it.")
endif()

add_library(adios2_blosc2 ALIAS ${adios2_blosc2_tgt})
Expand Down
91 changes: 0 additions & 91 deletions cmake/FindBlosc2.cmake

This file was deleted.

5 changes: 5 additions & 0 deletions cmake/adios2-config-common.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ else()
endif()

if(NOT @BUILD_SHARED_LIBS@)
set(ADIOS2_HAVE_Blosc2 @ADIOS2_HAVE_Blosc2@)
if(ADIOS2_HAVE_Blosc2)
find_dependency(Blosc2 2.10.1 CONFIG)
endif()

set(ADIOS2_HAVE_BZip2 @ADIOS2_HAVE_BZip2@)
if(ADIOS2_HAVE_BZip2)
find_dependency(BZip2)
Expand Down

0 comments on commit 3a12b46

Please sign in to comment.