]> www.ginac.de Git - ginac.git/blob - cmake/modules/FindLibDL.cmake
Really finalize 1.8.4 release.
[ginac.git] / cmake / modules / FindLibDL.cmake
1 # - Find libdl
2 # Find the native LIBDL includes and library
3 #
4 #  LIBDL_INCLUDE_DIR - where to find dlfcn.h, etc.
5 #  LIBDL_LIBRARIES   - List of libraries when using libdl.
6 #  LIBDL_FOUND       - True if libdl found.
7
8
9 IF (LIBDL_INCLUDE_DIR)
10         # Already in cache, be silent
11         SET(LIBDL_FIND_QUIETLY TRUE)
12 ENDIF (LIBDL_INCLUDE_DIR)
13
14 FIND_PATH(LIBDL_INCLUDE_DIR dlfcn.h)
15
16 SET(LIBDL_NAMES dl libdl ltdl libltdl)
17 FIND_LIBRARY(LIBDL_LIBRARY NAMES ${LIBDL_NAMES} )
18
19 # handle the QUIETLY and REQUIRED arguments and set LIBDL_FOUND to TRUE if
20 # all listed variables are TRUE
21 INCLUDE(FindPackageHandleStandardArgs)
22 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDL DEFAULT_MSG LIBDL_LIBRARY LIBDL_INCLUDE_DIR)
23
24 IF(LIBDL_FOUND)
25         SET( LIBDL_LIBRARIES ${LIBDL_LIBRARY} )
26 ELSE(LIBDL_FOUND)
27         SET( LIBDL_LIBRARIES )
28 ENDIF(LIBDL_FOUND)
29
30 MARK_AS_ADVANCED( LIBDL_LIBRARY LIBDL_INCLUDE_DIR )