forked from MDSplus/mdsplus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFindLibFFI.cmake
More file actions
71 lines (59 loc) · 1.19 KB
/
FindLibFFI.cmake
File metadata and controls
71 lines (59 loc) · 1.19 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# FindLibFFI.cmake
#
# Finds libLibFFI
#
# This will define the following variables
#
# LibFFI_FOUND
# LibFFI_INCLUDE_DIRS
# LibFFI_LIBRARIES
#
# and the following imported targets
#
# LibFFI::LibFFI
#
# The following variables can be set as arguments
#
# LibFFI_ROOT
#
find_package(PkgConfig QUIET)
pkg_check_modules(_LibFFI_PC QUIET ffi)
find_path(
LibFFI_INCLUDE_DIRS
NAMES ffi.h
HINTS
${_LibFFI_PC_INCLUDE_DIRS}
PATH_SUFFIXES
include
include/ffi
)
find_library(
LibFFI_LIBRARIES
NAMES ffi
HINTS
${_LibFFI_PC_LIBRARY_DIRS}
PATH_SUFFIXES
lib
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
LibFFI
REQUIRED_VARS
LibFFI_LIBRARIES
LibFFI_INCLUDE_DIRS
)
if(LibFFI_FOUND)
if(NOT TARGET LibFFI::LibFFI)
add_library(LibFFI::LibFFI INTERFACE IMPORTED)
set_target_properties(
LibFFI::LibFFI
PROPERTIES
INTERFACE_LINK_LIBRARIES "${LibFFI_LIBRARIES}"
INTERFACE_INCLUDE_DIRECTORIES "${LibFFI_INCLUDE_DIRS}"
)
endif()
endif()
mark_as_advanced(
LibFFI_INCLUDE_DIRS
LibFFI_LIBRARIES
)