use CMAKE_DL_LIBS
authorRolf Eike Beer <kde@opensource.sf-tec.de>
Wed, 29 Feb 2012 21:54:30 +0000 (22:54 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 19 Mar 2012 21:08:38 +0000 (22:08 +0100)
CMake provides a standard variable that holds the name of the library that
contains dlopen().

Signed-off-by: Bas Pape <baspape@gmail.com>
src/common/CMakeLists.txt

index 710cfbc..0e3e2a1 100644 (file)
@@ -90,16 +90,4 @@ if(APPLE)
   target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation")
 endif(APPLE)
 
-if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
-  set(FIND_LIBDL TRUE)
-endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
-if(CMAKE_HOST_SYSTEM_NAME STREQUAL "kFreeBSD")
-  set(FIND_LIBDL TRUE)
-endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "kFreeBSD")
-
-if(FIND_LIBDL)
-  find_library(libdl dl)
-  if(NOT libdl MATCHES "NOTFOUND")
-    target_link_libraries(mod_common ${libdl})
-  endif(NOT libdl MATCHES "NOTFOUND")
-endif(FIND_LIBDL)
+target_link_libraries(mod_common ${CMAKE_DL_LIBS})