| 1 |
# - Try to find libyaml |
| 2 |
# Once done, this will define |
| 3 |
# |
| 4 |
# LIBYAML_FOUND - system has libyaml |
| 5 |
# LIBYAML_INCLUDE_DIRS - the libyaml include directories |
| 6 |
# LIBYAML_LIBRARIES - link these to use libyaml |
| 7 |
|
| 8 |
include(LibFindMacros) |
| 9 |
|
| 10 |
# Use pkg-config to get hints about paths |
| 11 |
libfind_pkg_check_modules(LIBYAML_PKGCONF yaml-0.1) |
| 12 |
|
| 13 |
# Include dir |
| 14 |
find_path(LIBYAML_INCLUDE_DIR |
| 15 |
NAMES yaml.h |
| 16 |
PATHS ${LIBYAML_PKGCONF_INCLUDE_DIRS} |
| 17 |
) |
| 18 |
|
| 19 |
# Finally the library itself |
| 20 |
find_library(LIBYAML_LIBRARY |
| 21 |
NAMES libyaml.so |
| 22 |
PATHS ${LIBYAML_PKGCONF_LIBRARY_DIRS} |
| 23 |
) |
| 24 |
|
| 25 |
# Set the include dir variables and the libraries and let libfind_process do the rest. |
| 26 |
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. |
| 27 |
set(LIBYAML_PROCESS_INCLUDES LIBYAML_INCLUDE_DIR) |
| 28 |
set(LIBYAML_PROCESS_LIBS LIBYAML_LIBRARY) |
| 29 |
libfind_process(LIBYAML) |