Alex Stancu | 29ce368 | 2019-11-02 10:38:59 +0200 | [diff] [blame] | 1 | # SYSREPO_FOUND - System has libsysrepo |
| 2 | # SYSREPO_INCLUDE_DIRS - The libsysrepo include directories |
| 3 | # SYSREPO_LIBRARIES - The libraries needed to use libsysrepo |
| 4 | # SYSREPO_DEFINITIONS - Compiler switches required for using libsysrepo |
| 5 | |
| 6 | find_package(PkgConfig QUIET) |
| 7 | if(PKG_CONFIG_FOUND) |
| 8 | pkg_check_modules(PC_SYSREPO QUIET sysrepo) |
| 9 | set(SYSREPO_DEFINITIONS ${PC_SYSREPO_CFLAGS_OTHER}) |
| 10 | endif() |
| 11 | |
| 12 | find_path(SYSREPO_INCLUDE_DIR sysrepo.h |
| 13 | HINTS ${PC_SYSREPO_INCLUDEDIR} ${PC_SYSREPO_INCLUDE_DIRS} |
| 14 | PATH_SUFFIXES sysrepo) |
| 15 | |
| 16 | find_library(SYSREPO_LIBRARY NAMES sysrepo |
| 17 | HINTS ${PC_SYSREPO_LIBDIR} ${PC_SYSREPO_LIBRARY_DIRS}) |
| 18 | |
| 19 | set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY} ) |
| 20 | set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR}) |
| 21 | |
| 22 | include(FindPackageHandleStandardArgs) |
| 23 | find_package_handle_standard_args(sysrepo DEFAULT_MSG |
| 24 | SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR) |
| 25 | |
| 26 | mark_as_advanced(SYSREPO_INCLUDE_DIR SYSREPO_LIBRARY) |