diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2d474b877f0..8e191c87462 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1119,8 +1119,7 @@ if (BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (${HDF5_LIBSH_TARGET} SHARED) target_link_libraries (${HDF5_LIBSH_TARGET} PRIVATE ${LINK_LIBS} ${LINK_COMP_LIBS} - "$<$,$>:Threads::Threads>" - PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" + PUBLIC "$<$>:${CMAKE_DL_LIBS}>" "$<$:MPI::MPI_C>" "$<$,$>:Threads::Threads>" ) set_global_variable (HDF5_LIBRARIES_TO_EXPORT "${HDF5_LIBRARIES_TO_EXPORT};${HDF5_LIBSH_TARGET}") H5_SET_LIB_OPTIONS (${HDF5_LIBSH_TARGET} ${HDF5_LIB_NAME} SHARED "LIB") diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 85280b5eff5..e3defc91dde 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -569,12 +569,9 @@ target_include_directories (ttsafe PRIVATE "${HDF5_SRC_INCLUDE_DIRS};${HDF5_SRC_ if (NOT BUILD_SHARED_LIBS) TARGET_C_PROPERTIES (ttsafe STATIC) target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIB_TARGET}) - if (NOT WIN32) - target_link_libraries (ttsafe PRIVATE "$<$:Threads::Threads>") - endif () else () TARGET_C_PROPERTIES (ttsafe SHARED) - target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET} "$<$:Threads::Threads>") + target_link_libraries (ttsafe PRIVATE ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (ttsafe PROPERTIES FOLDER test)