openmw-tes3coop/cmake/FindLibFFI.cmake
Koncord 4ca5da5666 [Server] Rework Plugin API, move Lua system to external library
Use LibFFI for Public & Timer APIs
Use "PlayerId" type instead "unsigned short"
Add GetPluginDir() function
2019-02-12 05:29:57 +08:00

31 lines
No EOL
752 B
CMake

# FindLibFFI
#
# LIBFFI_FOUND - system has LibFFI
# LIBFFI_INCLUDE_DIRS - the LibFFI include directories
# LIBFFI_LIBRARIES - Link these to use LibFFI
if (NOT WIN32)
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBFFI QUIET libffi)
endif ()
find_path(LIBFFI_INCLUDE_DIR ffi.h
HINTS
${PC_LIBFFI_INCLUDEDIR}
${PC_LIBFFI_INCLUDE_DIRS}
$ENV{LIBFFI_HOME}/include
)
find_library(LIBFFI_LIBRARIES NAMES ffi libffi
HINTS
${PC_LIBFFI_LIBDIR}
${PC_LIBFFI_LIBRARY_DIRS}
$ENV{LIBFFI_HOME}/lib
)
mark_as_advanced(LIBFFI_INCLUDE_DIR LIBFFI_LIBRARIES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LibFFI DEFAULT_MSG
LIBFFI_LIBRARIES LIBFFI_INCLUDE_DIR
)