From fd68c0f047bbd40d02cad5a84584cc74979c993a Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Wed, 1 Jul 2009 20:45:25 +0200 Subject: ModuleManager: Benutze libdl anstatt ltdl --- FindDL.cmake | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 FindDL.cmake (limited to 'FindDL.cmake') diff --git a/FindDL.cmake b/FindDL.cmake new file mode 100644 index 0000000..584650f --- /dev/null +++ b/FindDL.cmake @@ -0,0 +1,37 @@ +# - Find dl functions +# This module finds dl libraries. +# +# It sets the following variables: +# DL_FOUND - Set to false, or undefined, if dl libraries aren't found. +# DL_INCLUDE_DIR - The dl include directory. +# DL_LIBRARY - The dl library to link against. + +INCLUDE(CheckFunctionExists) + +FIND_PATH(DL_INCLUDE_DIR NAMES dlfcn.h) +FIND_LIBRARY(DL_LIBRARY NAMES dl) + +IF (DL_LIBRARY) + SET(DL_FOUND TRUE) +ELSE (DL_LIBRARY) + # if dlopen can be found without linking in dl then, + # dlopen is part of libc, so don't need to link extra libs. + CHECK_FUNCTION_EXISTS(dlopen DL_FOUND) + SET(DL_LIBRARY "") +ENDIF (DL_LIBRARY) + +IF (DL_FOUND) + + # show which dl was found only if not quiet + IF (NOT DL_FIND_QUIETLY) + MESSAGE(STATUS "Found dl: ${DL_LIBRARY}") + ENDIF (NOT DL_FIND_QUIETLY) + +ELSE (DL_FOUND) + + # fatal error if dl is required but not found + IF (DL_FIND_REQUIRED) + MESSAGE(FATAL_ERROR "Could not find dl") + ENDIF (DL_FIND_REQUIRED) + +ENDIF (DL_FOUND) -- cgit v1.2.3