Skip to content

Commit 82c55e3

Browse files
committed
Fix HDF5 targets
1 parent 185e4b7 commit 82c55e3

1 file changed

Lines changed: 22 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -389,25 +389,25 @@ target_link_libraries(HydroChrono PUBLIC Chrono::Chrono_core)
389389
target_link_libraries(HydroChrono PUBLIC OpenMP::OpenMP_CXX)
390390

391391
# Add HDF5 (assume first latest HDF5 version 1.14.6 and prefer static library)
392-
if(TARGET hdf5-static)
393-
message(STATUS "Linking static libraries hdf5-static")
394-
target_link_libraries(HydroChrono PUBLIC hdf5-static)
395-
target_link_libraries(HydroChrono PUBLIC hdf5_cpp-static)
396-
target_link_libraries(HydroChrono PUBLIC hdf5_hl-static)
397-
target_link_libraries(HydroChrono PUBLIC hdf5_hl_cpp-static)
398-
target_link_libraries(HydroChrono PUBLIC hdf5_tools-static)
399-
elseif(TARGET hdf5-shared)
400-
message(STATUS "Linking shared libraries hdf5-shared")
401-
target_link_libraries(HydroChrono PUBLIC hdf5-shared)
402-
target_link_libraries(HydroChrono PUBLIC hdf5_cpp-shared)
403-
target_link_libraries(HydroChrono PUBLIC hdf5_hl-shared)
404-
target_link_libraries(HydroChrono PUBLIC hdf5_hl_cpp-shared)
405-
target_link_libraries(HydroChrono PUBLIC hdf5_tools-shared)
406-
list(APPEND HDF5_TARGETS hdf5-shared)
407-
list(APPEND HDF5_TARGETS hdf5_cpp-shared)
408-
list(APPEND HDF5_TARGETS hdf5_hl-shared)
409-
list(APPEND HDF5_TARGETS hdf5_hl_cpp-shared)
410-
list(APPEND HDF5_TARGETS hdf5_tools-shared)
392+
if(TARGET hdf5::hdf5-static)
393+
message(STATUS "Linking static libraries hdf5::hdf5-static")
394+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5-static)
395+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_cpp-static)
396+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl-static)
397+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl_cpp-static)
398+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_tools-static)
399+
elseif(TARGET hdf5::hdf5-shared)
400+
message(STATUS "Linking shared libraries hdf5::hdf5-shared")
401+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5-shared)
402+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_cpp-shared)
403+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl-shared)
404+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_hl_cpp-shared)
405+
target_link_libraries(HydroChrono PUBLIC hdf5::hdf5_tools-shared)
406+
list(APPEND HDF5_TARGETS hdf5::hdf5-shared)
407+
list(APPEND HDF5_TARGETS hdf5::hdf5_cpp-shared)
408+
list(APPEND HDF5_TARGETS hdf5::hdf5_hl-shared)
409+
list(APPEND HDF5_TARGETS hdf5::hdf5_hl_cpp-shared)
410+
list(APPEND HDF5_TARGETS hdf5::hdf5_tools-shared)
411411
elseif(TARGET HDF5::HDF5)
412412
message(STATUS "Linking HDF5::HDF5")
413413
target_link_libraries(HydroChrono PUBLIC HDF5::HDF5)
@@ -504,10 +504,10 @@ function(configure_test_environment)
504504
endif()
505505

506506
# HDF5 DLL path
507-
if(TARGET hdf5-static)
507+
if(TARGET hdf5::hdf5-static)
508508
message(STATUS " No HDF5 DLL (hdf5-static)")
509-
elseif(TARGET hdf5-shared)
510-
get_target_property(dll hdf5-shared IMPORTED_LOCATION_RELEASE)
509+
elseif(TARGET hdf5::hdf5-shared)
510+
get_target_property(dll hdf5::hdf5-shared IMPORTED_LOCATION_RELEASE)
511511
get_filename_component(dir ${dll} DIRECTORY)
512512
message(STATUS " HDF5 DLL directory (hdf5-shared): ${dir}")
513513
list(APPEND DLL_DIRS ${dir})

0 commit comments

Comments
 (0)