-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* [cgns] update to 4.3.0 * [cgns] update CI baseline * Fix version database. * CMake nitpicks * Use rename rather than copy and remove * Add quotes * Guard explicit references to debug in case the user is using a release-only triplet. * Use in lists * Convert hdf5.patch from CRLF to LF * update version * LIOSTS => LISTS * Revert cgnstools feature * update version Co-authored-by: Billy Robert O'Neal <bion@microsoft.com> Co-authored-by: Jonliu1993 <13720414433@163.com>
- Loading branch information
1 parent
74ff2a0
commit a563603
Showing
6 changed files
with
97 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,61 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index d871a9dc8..d2c631023 100644 | ||
index 60f9de4..e980ef7 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -232,46 +232,12 @@ if (CGNS_ENABLE_HDF5) | ||
@@ -261,51 +261,12 @@ if (CGNS_ENABLE_HDF5) | ||
cmake_policy(SET CMP0074 NEW) | ||
endif() | ||
|
||
- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) | ||
- message (STATUS "HDF5 C libs:${HDF5_FOUND} static:${HDF5_static_C_FOUND} and shared:${HDF5_shared_C_FOUND}") | ||
- if (HDF5_FOUND) | ||
- if (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) | ||
- set (FIND_HDF_COMPONENTS C) | ||
- if (CG_HDF5_LINK_TYPE STREQUAL "shared") | ||
- set(CG_HDF5_LINK_TYPE "static") | ||
- set(CG_HDF5_LINK_TYPE_UPPER "STATIC") | ||
- else() | ||
- set(CG_HDF5_LINK_TYPE "shared") | ||
- set(CG_HDF5_LINK_TYPE_UPPER "SHARED") | ||
- endif() | ||
- | ||
- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS}) | ||
- message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_FOUND}") | ||
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) | ||
- if (HDF5_BUILD_SHARED_LIBS) | ||
- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) | ||
- else (HDF5_BUILD_SHARED_LIBS) | ||
- add_definitions (-DH5_BUILT_AS_STATIC_LIB) | ||
- endif (HDF5_BUILD_SHARED_LIBS) | ||
- else (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) | ||
- if (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) | ||
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_SHARED_LIBRARY}) | ||
- else (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) | ||
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_C_STATIC_LIBRARY}) | ||
- endif (CGNS_BUILD_SHARED AND HDF5_shared_C_FOUND) | ||
- endif (NOT HDF5_static_C_FOUND AND NOT HDF5_shared_C_FOUND) | ||
- set (FIND_HDF_COMPONENTS C ${CG_HDF5_LINK_TYPE}) | ||
- | ||
- else (HDF5_FOUND) | ||
- find_package (HDF5 NAMES ${SEARCH_PACKAGE_NAME} COMPONENTS ${FIND_HDF_COMPONENTS} REQUIRED) | ||
- message (STATUS "HDF5 libs:${HDF5_FOUND} C:${HDF5_C_${CG_HDF5_LINK_TYPE_UPPER}_LIBRARY}") | ||
- endif() | ||
- | ||
- set(LINK_LIBS ${HDF5_C_${CG_HDF5_LINK_TYPE_UPPER}_LIBRARY}) | ||
- else () | ||
- find_package (HDF5) # Legacy find | ||
- | ||
- #Legacy find_package does not set HDF5_TOOLS_DIR, so we set it here | ||
- set(HDF5_TOOLS_DIR ${HDF5_LIBRARY}/../bin) | ||
- | ||
- #Legacy find_package does not set HDF5_BUILD_SHARED_LIBS, so we set it here | ||
- if (CGNS_BUILD_SHARED AND EXISTS "${HDF5_LIBRARY}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
- set(GUESS_SHARED "${HDF5_LIBRARY}/libhdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
- foreach (ITEM ${HDF5_LIBRARIES}) | ||
- if (ITEM MATCHES "(.*)hdf5${CMAKE_SHARED_LIBRARY_SUFFIX}") | ||
- set(GUESS_SHARED "${ITEM}") | ||
- break() | ||
- endif() | ||
- endforeach() | ||
- if (CGNS_BUILD_SHARED AND EXISTS "${GUESS_SHARED}") | ||
- set (HDF5_BUILD_SHARED_LIBS 1) | ||
- add_definitions (-DH5_BUILT_AS_DYNAMIC_LIB) | ||
- set (CG_HDF5_LINK_TYPE "shared") | ||
- set (CG_HDF5_LINK_TYPE_UPPER "SHARED") | ||
- else () | ||
- set (HDF5_BUILD_SHARED_LIBS 0) | ||
- add_definitions (-DH5_BUILT_AS_STATIC_LIB) | ||
- set (CG_HDF5_LINK_TYPE "static") | ||
- set (CG_HDF5_LINK_TYPE_UPPER "STATIC") | ||
- endif () | ||
- set (LINK_LIBS ${LINK_LIBS} ${HDF5_LIBRARIES}) | ||
- | ||
- endif (HDF5_FOUND) | ||
- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME}) | ||
- set (LINK_LIBS ${HDF5_LIBRARIES}) | ||
+ find_package (HDF5 CONFIG REQUIRED) | ||
+ if (TARGET hdf5::hdf5-shared) | ||
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-shared) | ||
+ else () | ||
+ set (LINK_LIBS ${LINK_LIBS} hdf5::hdf5-static) | ||
+ endif () | ||
endif () | ||
- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME}) | ||
|
||
if (HDF5_FOUND) | ||
if (NOT DEFINED HDF5_INCLUDE_DIRS) | ||
@@ -289,20 +255,10 @@ if (CGNS_ENABLE_HDF5) | ||
endif (HDF5_FOUND) | ||
|
||
set(HDF5_NEED_ZLIB "OFF" CACHE BOOL "Does the HDF5 library require linking to zlib?") | ||
- if(HDF5_NEED_ZLIB) | ||
- find_library(ZLIB_LIBRARY z) | ||
- mark_as_advanced(CLEAR ZLIB_LIBRARY) | ||
- else (HDF5_NEED_ZLIB) | ||
- mark_as_advanced(FORCE ZLIB_LIBRARY) | ||
- endif(HDF5_NEED_ZLIB) | ||
+ set(HDF5_NEED_ZLIB ${HDF5_ENABLE_Z_LIB_SUPPORT} CACHE INTERNAL "" FORCE) | ||
|
||
set(HDF5_NEED_SZIP "OFF" CACHE BOOL "Does the HDF5 library require linking to szip?") | ||
- if (HDF5_NEED_SZIP) | ||
- find_library(SZIP_LIBRARY szip) | ||
- mark_as_advanced(CLEAR SZIP_LIBRARY) | ||
- else (HDF5_NEED_SZIP) | ||
- mark_as_advanced(FORCE SZIP_LIBRARY) | ||
- endif (HDF5_NEED_SZIP) | ||
+ set(HDF5_NEED_SZIP ${HDF5_ENABLE_SZIP_SUPPORT} CACHE INTERNAL "" FORCE) | ||
|
||
# Check if HDF5 version is 1.8 or greater | ||
if (HDF5_VERSION VERSION_LESS "1.8.0") | ||
@@ -310,6 +266,7 @@ if (CGNS_ENABLE_HDF5) | ||
endif (HDF5_VERSION VERSION_LESS "1.8.0") | ||
|
||
set(HDF5_NEED_MPI "OFF" CACHE BOOL "Does the HDF5 library require linking to mpi? (Only true if using parallel HDF5)") | ||
+ set(HDF5_NEED_MPI ${HDF5_ENABLE_PARALLEL} CACHE INTERNAL "" FORCE) | ||
set(MPI_INC) | ||
set(MPI_LIBS) | ||
if (HDF5_NEED_MPI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters