File: FindRPM.cmake

package info (click to toggle)
openscap 1.4.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 125,040 kB
  • sloc: xml: 527,109; ansic: 91,390; sh: 19,789; python: 2,515; perl: 444; makefile: 49
file content (42 lines) | stat: -rw-r--r-- 1,101 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# - Try to find RPM
# Once done, this will define
#
#  RPM_FOUND - system has RPM
#  RPM_INCLUDE_DIRS - the RPM include directories
#  RPM_LIBRARIES - link these to use RPM

include(LibFindMacros)

# Use pkg-config to get hints about paths
libfind_pkg_check_modules(RPM_PKGCONF rpm)

# Include dir
find_path(RPM_INCLUDE_DIR
	NAMES rpm
	PATHS ${RPM_PKGCONF_INCLUDE_DIRS}
)

# Finally the library itself
find_library(RPM_LIBRARY
	NAMES rpm
	PATHS ${RPM_PKGCONF_LIBRARY_DIRS}
)
find_library(RPMIO_LIBRARY
	NAMES rpmio
	PATHS ${RPM_PKGCONF_LIBRARY_DIRS}
)

set(RPM_VERSION ${RPM_PKGCONF_VERSION})
if(RPM_VERSION)
	string(COMPARE GREATER "4.6" ${RPM_VERSION} RPM46_FOUND)
	string(COMPARE GREATER "4.7" ${RPM_VERSION} RPM47_FOUND)
	if(RPM_VERSION VERSION_GREATER_EQUAL "4.18")
		set(RPM418_FOUND 1)
	endif()
endif()

# Set the include dir variables and the libraries and let libfind_process do the rest.
# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
set(RPM_PROCESS_INCLUDES RPM_INCLUDE_DIR)
set(RPM_PROCESS_LIBS RPM_LIBRARY RPMIO_LIBRARY)
libfind_process(RPM)