forked from JonathanSalwan/Triton
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFindCAPSTONE.cmake
33 lines (26 loc) · 964 Bytes
/
FindCAPSTONE.cmake
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
# - Try to find CAPSTONE
# Once done, this will define
#
# CAPSTONE_FOUND - system has CAPSTONE
# CAPSTONE_INCLUDE_DIRS - the CAPSTONE include directories
# CAPSTONE_LIBRARIES - link these to use CAPSTONE
include(LibFindMacros)
# Dependencies
# libfind_package(CAPSTONE capstone)
# Use pkg-config to get hints about paths
# libfind_pkg_check_modules(CAPSTONE_PKGCONF capstone)
# Include dir
find_path(CAPSTONE_INCLUDE_DIR
NAMES capstone/capstone.h
PATHS ${CAPSTONE_PKGCONF_INCLUDE_DIRS}
)
# Finally the library itself
find_library(CAPSTONE_LIBRARY
NAMES capstone
PATHS ${CAPSTONE_PKGCONF_LIBRARY_DIRS}
)
# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(CAPSTONE_PROCESS_INCLUDES CAPSTONE_INCLUDE_DIR CAPSTONE_INCLUDE_DIRS)
set(CAPSTONE_PROCESS_LIBS CAPSTONE_LIBRARY CAPSTONE_LIBRARIES)
libfind_process(CAPSTONE)