diff options
-rw-r--r-- | CMakeFilters.cmake | 41 | ||||
-rw-r--r-- | CMakeLists.txt | 14 | ||||
-rw-r--r-- | config/toolchain/aarch64.cmake | 2 |
3 files changed, 28 insertions, 29 deletions
diff --git a/CMakeFilters.cmake b/CMakeFilters.cmake index 953a060..cac35d4 100644 --- a/CMakeFilters.cmake +++ b/CMakeFilters.cmake @@ -96,14 +96,15 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (NOT ZLIB_FOUND) find_package (ZLIB) # Legacy find endif () - endif () - if (ZLIB_FOUND) - set (H5_HAVE_FILTER_DEFLATE 1) - set (H5_HAVE_ZLIB_H 1) - set (H5_HAVE_LIBZ 1) - set (H5_ZLIB_HEADER "zlib.h") - set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) - set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) + if (ZLIB_FOUND) + set (H5_HAVE_FILTER_DEFLATE 1) + set (H5_HAVE_ZLIB_H 1) + set (H5_HAVE_LIBZ 1) + set (H5_ZLIB_HEADER "zlib.h") + set (ZLIB_INCLUDE_DIR_GEN ${ZLIB_INCLUDE_DIR}) + set (ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIR}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_LIBRARIES}) + endif () else () if (BUILD_ZLIB_WITH_FETCHCONTENT) # Only tgz files available @@ -114,6 +115,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "HDF5_ZLIB is built from fetch content") endif () + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_ZLIB_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT}) set (H5_HAVE_FILTER_DEFLATE 1) @@ -122,6 +124,7 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "Filter HDF5_ZLIB is built") endif () + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) else () message (FATAL_ERROR " ZLib is Required for ZLib support in HDF5") endif () @@ -135,7 +138,6 @@ if (HDF5_ENABLE_Z_LIB_SUPPORT) if (H5_HAVE_FILTER_DEFLATE) set (EXTERNAL_FILTERS "${EXTERNAL_FILTERS} DEFLATE") endif () - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${ZLIB_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${ZLIB_INCLUDE_DIRS}) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "Filter HDF5_ZLIB is ON") @@ -153,20 +155,24 @@ if (HDF5_ENABLE_SZIP_SUPPORT) if (USE_LIBAEC) set(libaec_USE_STATIC_LIBS ${USE_LIBAEC_STATIC}) find_package (libaec 1.0.5 CONFIG) + if (SZIP_FOUND) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + endif () endif () if (NOT SZIP_FOUND) find_package (SZIP NAMES ${SZIP_PACKAGE_NAME}${HDF_PACKAGE_EXT} COMPONENTS static shared) if (NOT SZIP_FOUND) find_package (SZIP) # Legacy find endif () + if (SZIP_FOUND) + set (H5_HAVE_FILTER_SZIP 1) + set (H5_HAVE_SZLIB_H 1) + set (H5_HAVE_LIBSZ 1) + set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) + set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_LIBRARIES}) + endif () endif () - endif () - if (SZIP_FOUND) - set (H5_HAVE_FILTER_SZIP 1) - set (H5_HAVE_SZLIB_H 1) - set (H5_HAVE_LIBSZ 1) - set (SZIP_INCLUDE_DIR_GEN ${SZIP_INCLUDE_DIR}) - set (SZIP_INCLUDE_DIRS ${SZIP_INCLUDE_DIRS} ${SZIP_INCLUDE_DIR}) else () if (BUILD_SZIP_WITH_FETCHCONTENT) # Only tgz files available @@ -185,6 +191,7 @@ if (HDF5_ENABLE_SZIP_SUPPORT) else () set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) endif () + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) elseif (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") EXTERNAL_SZIP_LIBRARY (${HDF5_ALLOW_EXTERNAL_SUPPORT} ${HDF5_ENABLE_SZIP_ENCODING}) set (H5_HAVE_FILTER_SZIP 1) @@ -201,11 +208,11 @@ if (HDF5_ENABLE_SZIP_SUPPORT) else () set (SZIP_PACKAGE_NAME ${SZIP_PACKAGE_NAME}) endif () + set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) else () message (FATAL_ERROR "SZIP is Required for SZIP support in HDF5") endif () endif () - set (LINK_COMP_LIBS ${LINK_COMP_LIBS} ${SZIP_STATIC_LIBRARY}) INCLUDE_DIRECTORIES (${SZIP_INCLUDE_DIRS}) if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.15.0") message (VERBOSE "Filter SZIP is ON") diff --git a/CMakeLists.txt b/CMakeLists.txt index 326530e..e09ee38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -878,20 +878,12 @@ endif () add_subdirectory (src) if (HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "GIT" OR HDF5_ALLOW_EXTERNAL_SUPPORT MATCHES "TGZ") - if (ZLIB_FOUND AND ZLIB_USE_EXTERNAL) + if ((ZLIB_FOUND AND ZLIB_USE_EXTERNAL) OR (SZIP_FOUND AND SZIP_USE_EXTERNAL)) if (NOT ONLY_SHARED_LIBS) - add_dependencies (${HDF5_LIB_TARGET} ${ZLIB_STATIC_LIBRARY}) + add_dependencies (${HDF5_LIB_TARGET} ${LINK_COMP_LIBS}) endif () if (BUILD_SHARED_LIBS) - add_dependencies (${HDF5_LIBSH_TARGET} ${ZLIB_STATIC_LIBRARY}) - endif () - endif () - if (SZIP_FOUND AND SZIP_USE_EXTERNAL) - if (NOT ONLY_SHARED_LIBS) - add_dependencies (${HDF5_LIB_TARGET} ${SZIP_STATIC_LIBRARY}) - endif () - if (BUILD_SHARED_LIBS) - add_dependencies (${HDF5_LIBSH_TARGET} ${SZIP_STATIC_LIBRARY}) + add_dependencies (${HDF5_LIBSH_TARGET} ${LINK_COMP_LIBS}) endif () endif () endif () diff --git a/config/toolchain/aarch64.cmake b/config/toolchain/aarch64.cmake index adb8639..aa84a74 100644 --- a/config/toolchain/aarch64.cmake +++ b/config/toolchain/aarch64.cmake @@ -1,5 +1,5 @@ set(TOOLCHAIN_PREFIX aarch64-linux-gnu) -set(ANDROID_NDK /opt/android-ndk-r25b-linux/android-ndk-r25b) +set(ANDROID_NDK /opt/android-ndk-linux) set (CMAKE_SYSTEM_NAME Android) set (CMAKE_ANDROID_ARCH_ABI x86_64) #set (CMAKE_ANDROID_STANDALONE_TOOLCHAIN ${ANDROID_NDK}/build/cmake/andriod.toolchain.cmake) |