blob: 7bce85c5220324caf2bbe14574e2e7b19806b4a8 [file] [log] [blame]
Alex Stancu29ce3682019-11-02 10:38:59 +02001# 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
6find_package(PkgConfig QUIET)
7if(PKG_CONFIG_FOUND)
8 pkg_check_modules(PC_SYSREPO QUIET sysrepo)
9 set(SYSREPO_DEFINITIONS ${PC_SYSREPO_CFLAGS_OTHER})
10endif()
11
12find_path(SYSREPO_INCLUDE_DIR sysrepo.h
13 HINTS ${PC_SYSREPO_INCLUDEDIR} ${PC_SYSREPO_INCLUDE_DIRS}
14 PATH_SUFFIXES sysrepo)
15
16find_library(SYSREPO_LIBRARY NAMES sysrepo
17 HINTS ${PC_SYSREPO_LIBDIR} ${PC_SYSREPO_LIBRARY_DIRS})
18
19set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY} )
20set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR})
21
22include(FindPackageHandleStandardArgs)
23find_package_handle_standard_args(sysrepo DEFAULT_MSG
24 SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR)
25
26mark_as_advanced(SYSREPO_INCLUDE_DIR SYSREPO_LIBRARY)