2015-10-08 19:33:52 -04:00
|
|
|
# Stick to traditional approaches here. The following are defined.
|
|
|
|
|
|
2019-02-16 11:32:52 -05:00
|
|
|
# DL_FOUND - The system has the dl library. DL_INCLUDE_DIR - The dl include
|
|
|
|
|
# directory. DL_LIBRARIES - The library file to link to.
|
2015-10-08 19:33:52 -04:00
|
|
|
|
2019-02-16 11:32:52 -05:00
|
|
|
if(DL_INCLUDE_DIR AND DL_LIBRARIES)
|
2015-10-08 19:33:52 -04:00
|
|
|
# Already in cache, so don't repeat the finding procedures.
|
|
|
|
|
set(DL_FIND_QUIETLY TRUE)
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-02-16 11:32:52 -05:00
|
|
|
find_path(DL_INCLUDE_DIR dlfcn.h PATHS /usr/local/include /usr/include)
|
2015-10-08 19:33:52 -04:00
|
|
|
|
2019-02-16 11:32:52 -05:00
|
|
|
find_library(DL_LIBRARIES dl PATHS /usr/local/lib /usr/lib /lib)
|
2015-10-08 19:33:52 -04:00
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
find_package_handle_standard_args(DL DEFAULT_MSG DL_LIBRARIES DL_INCLUDE_DIR)
|
|
|
|
|
|
|
|
|
|
mark_as_advanced(DL_INCLUDE_DIR DL_LIBRARIES)
|