mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-30 11:19:00 +08:00
30 lines
926 B
Diff
30 lines
926 B
Diff
|
diff --git a/CMake/FindCGNS.cmake b/CMake/FindCGNS.cmake
|
||
|
index 005f1afd9..a45103a9f 100644
|
||
|
--- a/CMake/FindCGNS.cmake
|
||
|
+++ b/CMake/FindCGNS.cmake
|
||
|
@@ -16,7 +16,7 @@ mark_as_advanced(CGNS_INCLUDE_DIR)
|
||
|
|
||
|
find_library(CGNS_LIBRARY
|
||
|
NAMES
|
||
|
- cgns
|
||
|
+ cgnsdll cgns
|
||
|
DOC "CGNS library")
|
||
|
mark_as_advanced(CGNS_LIBRARY)
|
||
|
|
||
|
@@ -45,4 +45,15 @@ if (CGNS_FOUND)
|
||
|
IMPORTED_LOCATION "${CGNS_LIBRARY}"
|
||
|
INTERFACE_INCLUDE_DIRECTORIES "${CGNS_INCLUDE_DIR}")
|
||
|
endif ()
|
||
|
+ include(CMakeFindDependencyMacro)
|
||
|
+ find_dependency(hdf5 CONFIG)
|
||
|
+ if(TARGET hdf5::hdf5-shared)
|
||
|
+ set_property(TARGET CGNS::CGNS APPEND PROPERTY
|
||
|
+ INTERFACE_LINK_LIBRARIES "hdf5::hdf5-shared")
|
||
|
+ elseif(TARGET hdf5::hdf5-static)
|
||
|
+ set_property(TARGET CGNS::CGNS APPEND PROPERTY
|
||
|
+ INTERFACE_LINK_LIBRARIES "hdf5::hdf5-static")
|
||
|
+ else()
|
||
|
+ message(FATAL_ERROR "No HDF5 target to link cgns against")
|
||
|
+ endif()
|
||
|
endif ()
|