-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathFindDl.cmake
More file actions
45 lines (40 loc) · 1.23 KB
/
FindDl.cmake
File metadata and controls
45 lines (40 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
###############################################################################
# Copyright (c) 2014-2026 libbitcoin developers (see COPYING).
#
###############################################################################
# Finddl
#
# Use this module by invoking find_package with the form::
#
# find_package( dl
# [REQUIRED] # Fail with error if dl is not found
# )
#
# Defines the following for use:
#
# dl_FOUND - True if headers and requested libraries were found
# dl_LIBRARIES - dl libraries to be linked
# dl_LIBS - dl libraries to be linked
#
if (DEFINED dl_FIND_VERSION)
message( SEND_ERROR "Library 'dl' unable to process specified version: ${dl_FIND_VERSION}" )
endif()
if (MSVC)
message( STATUS "MSVC environment detection for 'dl' not currently supported." )
set( dl_FOUND false )
else ()
# required
if ( dl_FIND_REQUIRED )
set( _dl_REQUIRED "REQUIRED" )
endif()
find_library(dl_LIBRARIES dl)
if (dl_LIBRARIES-NOTFOUND)
set( dl_FOUND false )
else ()
set( dl_FOUND true )
set( dl_LIBS "-ldl" )
endif()
endif()
if ( dl_FIND_REQUIRED AND ( NOT dl_FOUND ) )
message( SEND_ERROR "Library 'dl' not found." )
endif()