mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 10:21:07 +08:00
a563603129
* [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>
62 lines
2.2 KiB
Diff
62 lines
2.2 KiB
Diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
index 60f9de4..e980ef7 100644
|
|
--- a/CMakeLists.txt
|
|
+++ b/CMakeLists.txt
|
|
@@ -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)
|
|
- 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()
|
|
-
|
|
- set (FIND_HDF_COMPONENTS C ${CG_HDF5_LINK_TYPE})
|
|
-
|
|
- 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
|
|
- 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)
|
|
- set (CG_HDF5_LINK_TYPE "shared")
|
|
- set (CG_HDF5_LINK_TYPE_UPPER "SHARED")
|
|
- else ()
|
|
- set (HDF5_BUILD_SHARED_LIBS 0)
|
|
- set (CG_HDF5_LINK_TYPE "static")
|
|
- set (CG_HDF5_LINK_TYPE_UPPER "STATIC")
|
|
- endif ()
|
|
- 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 ()
|
|
- set (HDF5_PACKAGE_NAME ${SEARCH_PACKAGE_NAME})
|
|
|
|
if (HDF5_FOUND)
|
|
if (NOT DEFINED HDF5_INCLUDE_DIRS)
|