Rename `caml_realpath` to `hh_realpath`
[hiphop-php.git] / CMake / FindLibDL.cmake
blob9ebef5601a83d0585f20c39f5513ee8747ee3553
1 # - Try to find libdl
2 # Once done this will define
4 #  LIBDL_FOUND - system has libdl
5 #  LIBDL_INCLUDE_DIRS - the libdl include directory
6 #  LIBDL_LIBRARIES - Link these to use libdl
7 #  LIBDL_NEEDS_UNDERSCORE - If extern "C" symbols are prefixed (BSD/Apple)
10 find_path (LIBDL_INCLUDE_DIRS NAMES dlfcn.h)
11 find_library (LIBDL_LIBRARIES NAMES dl)
12 include (FindPackageHandleStandardArgs)
14 FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibDL DEFAULT_MSG
15     LIBDL_LIBRARIES
16     LIBDL_INCLUDE_DIRS)
18 SET(CMAKE_REQUIRED_LIBRARIES dl)
19 INCLUDE(CheckCSourceRuns)
20 CHECK_C_SOURCE_RUNS("#include <dlfcn.h>
21 void testfunc() {}
22 int main() {
23   testfunc();
24   return dyslm(0, \"_testfunc\") != (void*)0;
25 }" LIBDL_NEEDS_UNDERSCORE)
27 mark_as_advanced(LIBDL_INCLUDE_DIRS LIBDL_LIBRARIES LIBDL_NEEDS_UNDERSCORE)