1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
From: Enrico Zini <enrico@debian.org>
Date: Thu, 27 Mar 2025 13:49:54 +0000
Subject: do not download external library but use Debian package instead
---
CMakeLists.txt | 22 +++++-----------------
1 file changed, 5 insertions(+), 17 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9ec0f23..bfaa22e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,9 +1,10 @@
cmake_minimum_required(VERSION 2.8.10)
cmake_policy(SET CMP0074 NEW)
project(blosc_hdf5)
-include(ExternalProject)
include(GNUInstallDirs)
+find_package(PkgConfig)
+
# options
option(BUILD_TESTS
"Build test programs form the blosc filter" ON)
@@ -24,15 +25,6 @@ message("BLOSC_INSTALL_DIR='${BLOSC_INSTALL_DIR}'")
message("BLOSC_CMAKE_ARGS='${BLOSC_CMAKE_ARGS}'")
message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
-ExternalProject_Add(project_blosc
- PREFIX ${BLOSC_PREFIX}
- GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
- GIT_TAG main
- INSTALL_DIR ${BLOSC_INSTALL_DIR}
- CMAKE_ARGS ${BLOSC_CMAKE_ARGS}
-)
-
-
# sources
set(SOURCES src/blosc_filter.c)
set(PLUGIN_SOURCES src/blosc_filter.c src/blosc_plugin.c )
@@ -50,25 +42,21 @@ if(MSVC)
else(MSVC)
find_package(HDF5 REQUIRED)
endif(MSVC)
+pkg_check_modules(BLOSC REQUIRED blosc)
include_directories(${HDF5_INCLUDE_DIRS})
# add blosc libraries
-add_library(blosc_shared SHARED IMPORTED)
-set_property(TARGET blosc_shared PROPERTY IMPORTED_LOCATION ${BLOSC_INSTALL_DIR}/${CMAKE_INSTALL_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}blosc${CMAKE_SHARED_LIBRARY_SUFFIX})
-add_dependencies(blosc_shared project_blosc)
-include_directories(${BLOSC_INSTALL_DIR}/include)
-
add_library(blosc_filter_shared SHARED ${SOURCES})
set_target_properties(
blosc_filter_shared PROPERTIES OUTPUT_NAME blosc_filter)
-target_link_libraries(blosc_filter_shared blosc_shared ${HDF5_LIBRARIES})
+target_link_libraries(blosc_filter_shared ${HDF5_LIBRARIES} ${BLOSC_LIBRARIES})
if(BUILD_PLUGIN)
add_library(blosc_plugin_shared SHARED ${PLUGIN_SOURCES})
set_target_properties(
blosc_plugin_shared PROPERTIES OUTPUT_NAME H5Zblosc)
- target_link_libraries(blosc_plugin_shared blosc_shared ${HDF5_LIBRARIES})
+ target_link_libraries(blosc_plugin_shared ${HDF5_LIBRARIES} ${BLOSC_LIBRARIES})
install(TARGETS blosc_plugin_shared DESTINATION ${PLUGIN_INSTALL_PATH} COMPONENT HDF5_FILTER_DEV)
endif(BUILD_PLUGIN)
|