FindDL.cmake 564 B

1234567891011121314151617
  1. # - find where dlopen and friends are located.
  2. # DL_FOUND - system has dynamic linking interface available
  3. # DL_INCLUDE_DIR - where dlfcn.h is located.
  4. # DL_LIBRARIES - libraries needed to use dlopen
  5. include(CheckFunctionExists)
  6. find_path(DL_INCLUDE_DIR NAMES dlfcn.h)
  7. find_library(DL_LIBRARIES NAMES dl)
  8. if(DL_LIBRARIES)
  9. set(DL_FOUND TRUE)
  10. else(DL_LIBRARIES)
  11. check_function_exists(dlopen DL_FOUND)
  12. # If dlopen can be found without linking in dl then dlopen is part
  13. # of libc, so don't need to link extra libs.
  14. set(DL_LIBRARIES "")
  15. endif(DL_LIBRARIES)