forked from telekom/sysrepo-plugin-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
21 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,25 @@ | ||
# SYSREPO_FOUND - System has SYSREPO | ||
# SYSREPO_INCLUDE_DIRS - The SYSREPO include directories | ||
# SYSREPO_LIBRARIES - The libraries needed to use SYSREPO | ||
# SYSREPO_DEFINITIONS - Compiler switches required for using SYSREPO | ||
if (SYSREPO_LIBRARIES AND SYSREPO_INCLUDE_DIRS) | ||
set(SYSREPO_FOUND TRUE) | ||
else () | ||
|
||
find_package(PkgConfig) | ||
pkg_check_modules(PC_SYSREPO QUIET sysrepo) | ||
set(SYSREPO_DEFINITIONS ${PC_SYSREPO_CFLAGS_OTHER}) | ||
find_path( | ||
SYSREPO_INCLUDE_DIR | ||
NAMES sysrepo.h | ||
PATHS /usr/include /usr/local/include /opt/local/include /sw/include ${CMAKE_INCLUDE_PATH} ${CMAKE_INSTALL_PREFIX}/include | ||
) | ||
|
||
find_path(SYSREPO_INCLUDE_DIR sysrepo.h | ||
HINTS ${PC_SYSREPO_INCLUDEDIR} ${PC_SYSREPO_INCLUDE_DIRS} | ||
PATH_SUFFIXES sysrepo ) | ||
find_library( | ||
SYSREPO_LIBRARY | ||
NAMES sysrepo | ||
PATHS /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64 /opt/local/lib /sw/lib ${CMAKE_LIBRARY_PATH} ${CMAKE_INSTALL_PREFIX}/lib | ||
) | ||
|
||
find_library(SYSREPO_LIBRARY NAMES sysrepo | ||
HINTS ${PC_SYSREPO_LIBDIR} ${PC_SYSREPO_LIBRARY_DIRS} ) | ||
if (SYSREPO_INCLUDE_DIR AND SYSREPO_LIBRARY) | ||
set(SYSREPO_FOUND TRUE) | ||
else (SYSREPO_INCLUDE_DIR AND SYSREPO_LIBRARY) | ||
set(SYSREPO_FOUND FALSE) | ||
endif (SYSREPO_INCLUDE_DIR AND SYSREPO_LIBRARY) | ||
|
||
set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY} ) | ||
set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR} ) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
# handle the QUIETLY and REQUIRED arguments and set SYSREPO_FOUND to TRUE | ||
# if all listed variables are TRUE | ||
find_package_handle_standard_args(sysrepo DEFAULT_MSG | ||
SYSREPO_LIBRARY SYSREPO_INCLUDE_DIR) | ||
|
||
mark_as_advanced(SYSREPO_INCLUDE_DIR SYSREPO_LIBRARY ) | ||
set(SYSREPO_INCLUDE_DIRS ${SYSREPO_INCLUDE_DIR}) | ||
set(SYSREPO_LIBRARIES ${SYSREPO_LIBRARY}) | ||
endif () |