--- Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt.orig	2019-07-28 10:06:31 UTC
+++ Modules/ThirdParty/MINC/src/libminc/CMakeLists.txt
@@ -403,11 +403,11 @@ SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_LIBRARY_STATIC}
 SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY_NAME} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY_NAME})
 
 IF(UNIX)
-  SET(LIBMINC_LIBRARIES ${LIBMINC_LIBRARIES} m dl ${RT_LIBRARY})
-  SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_STATIC_LIBRARIES} m dl  ${RT_LIBRARY})
+  SET(LIBMINC_LIBRARIES ${LIBMINC_LIBRARIES} m ${CMAKE_DL_LIBS} ${RT_LIBRARY})
+  SET(LIBMINC_STATIC_LIBRARIES ${LIBMINC_STATIC_LIBRARIES} m ${CMAKE_DL_LIBS}  ${RT_LIBRARY})
   
-  SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARIES_CONFIG} m dl ${RT_LIBRARY_NAME})
-  SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_STATIC_LIBRARIES_CONFIG} m dl ${RT_LIBRARY_NAME})
+  SET(LIBMINC_LIBRARIES_CONFIG ${LIBMINC_LIBRARIES_CONFIG} m ${CMAKE_DL_LIBS} ${RT_LIBRARY_NAME})
+  SET(LIBMINC_STATIC_LIBRARIES_CONFIG ${LIBMINC_STATIC_LIBRARIES_CONFIG} m ${CMAKE_DL_LIBS} ${RT_LIBRARY_NAME})
 ENDIF(UNIX)
 
 SET(minc_LIB_SRCS ${minc2_LIB_SRCS} ${minc_common_SRCS})
@@ -447,13 +447,13 @@ ENDIF(NOT LIBMINC_USE_SYSTEM_NIFTI  AND NOT LIBMINC_EX
 #EXPORT(TARGETS ${LIBMINC_LIBRARY} FILE "${LIBMINC_EXPORTED_TARGETS}.cmake")
 
 IF(UNIX)
-  TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} m dl )
+  TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} m ${CMAKE_DL_LIBS} )
 
 #ITK: Skip static library build
 IF(0)
   IF(LIBMINC_BUILD_SHARED_LIBS)
     ADD_LIBRARY(${LIBMINC_LIBRARY_STATIC} STATIC ${minc_LIB_SRCS} ${minc_HEADERS} ${volume_io_LIB_SRCS} ${volume_io_HEADERS} )
-    TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY} ${RT_LIBRARY} m dl )
+    TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY_STATIC} ${HDF5_LIBRARY} ${NIFTI_LIBRARIES} ${ZLIB_LIBRARY} ${RT_LIBRARY} m ${CMAKE_DL_LIBS} )
     IF(LIBMINC_MINC1_SUPPORT)
       TARGET_LINK_LIBRARIES(${LIBMINC_LIBRARY} ${NETCDF_LIBRARY})
     ENDIF(LIBMINC_MINC1_SUPPORT)
