Use cmake standard mechanism for finding dlopen

This commit is contained in:
Martin Natano
2022-06-07 12:40:33 +02:00
parent 1da34b9ba2
commit 087d4576cc
3 changed files with 6 additions and 38 deletions
-18
View File
@@ -1,18 +0,0 @@
# Stick to traditional approaches here. The following are defined.
# DL_FOUND - The system has the dl library. DL_INCLUDE_DIR - The dl include
# directory. DL_LIBRARIES - The library file to link to.
if(DL_INCLUDE_DIR AND DL_LIBRARIES)
# Already in cache, so don't repeat the finding procedures.
set(DL_FIND_QUIETLY TRUE)
endif()
find_path(DL_INCLUDE_DIR dlfcn.h PATHS /usr/local/include /usr/include)
find_library(DL_LIBRARIES dl PATHS /usr/local/lib /usr/lib /lib)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(DL DEFAULT_MSG DL_LIBRARIES DL_INCLUDE_DIR)
mark_as_advanced(DL_INCLUDE_DIR DL_LIBRARIES)