diff --git a/CMakeLists.txt b/CMakeLists.txt index c25cbbc4f01..eb7ca6d1369 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,10 @@ if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) cmake_policy(SET CMP0054 OLD) endif() +if(CMAKE_VERSION VERSION_LESS "3.0") + SET(CMAKE_DL_LIBS "-ldl") +endif() + include( XRootDUtils ) CheckBuildDirectory() diff --git a/src/XrdApps.cmake b/src/XrdApps.cmake index dadd2806279..168901e2e3f 100644 --- a/src/XrdApps.cmake +++ b/src/XrdApps.cmake @@ -138,7 +138,7 @@ target_link_libraries( XrdClient XrdUtils XrdAppUtils - dl + ${CMAKE_DL_LIBS} pthread ${EXTRA_LIBS} ) diff --git a/src/XrdCl/CMakeLists.txt b/src/XrdCl/CMakeLists.txt index 484f2ff70ee..1958b6eb9a6 100644 --- a/src/XrdCl/CMakeLists.txt +++ b/src/XrdCl/CMakeLists.txt @@ -77,7 +77,7 @@ target_link_libraries( XrdXml XrdUtils pthread - dl) + ${CMAKE_DL_LIBS}) set_target_properties( XrdCl diff --git a/src/XrdClient.cmake b/src/XrdClient.cmake index 57c592ff3f5..2d977215cde 100644 --- a/src/XrdClient.cmake +++ b/src/XrdClient.cmake @@ -42,7 +42,7 @@ add_library( target_link_libraries( XrdClient XrdUtils - dl + ${CMAKE_DL_LIBS} pthread ) set_target_properties( diff --git a/src/XrdCrypto.cmake b/src/XrdCrypto.cmake index 24045fdecfe..c80dea2b8d6 100644 --- a/src/XrdCrypto.cmake +++ b/src/XrdCrypto.cmake @@ -36,7 +36,7 @@ add_library( target_link_libraries( XrdCrypto XrdUtils - dl ) + ${CMAKE_DL_LIBS} ) set_target_properties( XrdCrypto diff --git a/src/XrdDaemons.cmake b/src/XrdDaemons.cmake index 8d09846a94a..4efb5ff3db8 100644 --- a/src/XrdDaemons.cmake +++ b/src/XrdDaemons.cmake @@ -15,7 +15,7 @@ target_link_libraries( xrootd XrdServer XrdUtils - dl + ${CMAKE_DL_LIBS} pthread ${EXTRA_LIBS} ${SOCKET_LIBRARY} ) diff --git a/src/XrdHttp.cmake b/src/XrdHttp.cmake index adcc1ecb93b..de96a4398d7 100644 --- a/src/XrdHttp.cmake +++ b/src/XrdHttp.cmake @@ -41,7 +41,7 @@ if( BUILD_HTTP ) XrdServer XrdUtils XrdCrypto - dl + ${CMAKE_DL_LIBS} pthread ${OPENSSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} ) diff --git a/src/XrdMacaroons.cmake b/src/XrdMacaroons.cmake index f6d42004190..5d7fa608466 100644 --- a/src/XrdMacaroons.cmake +++ b/src/XrdMacaroons.cmake @@ -21,7 +21,7 @@ if( BUILD_MACAROONS ) XrdMacaroons/XrdMacaroonsConfigure.cc) target_link_libraries( - ${LIB_XRD_MACAROONS} -ldl + ${LIB_XRD_MACAROONS} ${CMAKE_DL_LIBS} XrdHttpUtils XrdUtils XrdServer diff --git a/src/XrdPosix.cmake b/src/XrdPosix.cmake index 59ba01ad60d..98e3371cb37 100644 --- a/src/XrdPosix.cmake +++ b/src/XrdPosix.cmake @@ -61,7 +61,7 @@ add_library( target_link_libraries( XrdPosixPreload XrdPosix - dl ) + ${CMAKE_DL_LIBS} ) set_target_properties( XrdPosixPreload diff --git a/src/XrdSec.cmake b/src/XrdSec.cmake index 9a07a88c3d1..9bf108eb5fa 100644 --- a/src/XrdSec.cmake +++ b/src/XrdSec.cmake @@ -29,7 +29,7 @@ target_link_libraries( ${LIB_XRD_SEC} XrdUtils pthread - dl ) + ${CMAKE_DL_LIBS} ) set_target_properties( ${LIB_XRD_SEC} diff --git a/src/XrdServer.cmake b/src/XrdServer.cmake index 265c304462d..2eed6912bfd 100644 --- a/src/XrdServer.cmake +++ b/src/XrdServer.cmake @@ -161,7 +161,7 @@ add_library( target_link_libraries( XrdServer XrdUtils - dl + ${CMAKE_DL_LIBS} pthread ${EXTRA_LIBS} ${SOCKET_LIBRARY} ) diff --git a/src/XrdTpc.cmake b/src/XrdTpc.cmake index cb6b4b9f652..db74489de79 100644 --- a/src/XrdTpc.cmake +++ b/src/XrdTpc.cmake @@ -30,7 +30,7 @@ if( BUILD_TPC ) XrdServer XrdUtils XrdHttpUtils - dl + ${CMAKE_DL_LIBS} pthread ${CURL_LIBRARIES} ) diff --git a/src/XrdUtils.cmake b/src/XrdUtils.cmake index 6a5f2199dd1..2130b4e3e70 100644 --- a/src/XrdUtils.cmake +++ b/src/XrdUtils.cmake @@ -197,7 +197,7 @@ add_library( target_link_libraries( XrdUtils pthread - dl + ${CMAKE_DL_LIBS} ${SOCKET_LIBRARY} ${SENDFILE_LIBRARY} ${EXTRA_LIBS} ) diff --git a/tests/common/CMakeLists.txt b/tests/common/CMakeLists.txt index d9cca88841b..5c395238ee9 100644 --- a/tests/common/CMakeLists.txt +++ b/tests/common/CMakeLists.txt @@ -17,7 +17,7 @@ target_link_libraries( XrdUtils) add_executable(text-runner TextRunner.cc PathProcessor.hh) -target_link_libraries(text-runner dl ${CPPUNIT_LIBRARIES} pthread) +target_link_libraries(text-runner ${CMAKE_DL_LIBS} ${CPPUNIT_LIBRARIES} pthread) #------------------------------------------------------------------------------- # Install