Imported Upstream version 17.14.1
[platform/upstream/libzypp.git] / CMakeLists.txt
index 1c018ec..8f0ca27 100644 (file)
@@ -113,6 +113,7 @@ IF ( ENABLE_USE_THREADS )
   ENDIF ( CMAKE_USE_PTHREADS_INIT )
 ENDIF ( ENABLE_USE_THREADS )
 
+INCLUDE(CheckSymbolExists)
 FIND_PACKAGE(Rpm REQUIRED)
 IF ( NOT RPM_FOUND)
   MESSAGE( FATAL_ERROR " rpm-devel not found" )
@@ -120,6 +121,15 @@ ELSE ( NOT RPM_FOUND)
   INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR})
   # fix includes not relative to rpm
   INCLUDE_DIRECTORIES(${RPM_INCLUDE_DIR}/rpm)
+
+  # rpmtsSetVfyFlags were introduced in rpm-4.15
+  UNSET( RPMTSSETVFYFLAGS_FOUND CACHE )
+  SET( CMAKE_REQUIRED_LIBRARIES "-lrpm" )
+  CHECK_SYMBOL_EXISTS( rpmtsSetVfyFlags rpm/rpmts.h RPMTSSETVFYFLAGS_FOUND )
+  IF ( NOT RPMTSSETVFYFLAGS_FOUND )
+    ADD_DEFINITIONS( -DHAVE_NO_RPMTSSETVFYFLAGS )
+  ENDIF ()
+
   if ( RPM_SUSPECT_VERSION STREQUAL "5.x" )
        MESSAGE( STATUS "rpm found: enable rpm-4 compat interface." )
        ADD_DEFINITIONS(-D_RPM_5)