summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Kämpf <kkaempf@suse.de>2010-11-13 17:35:04 +0100
committerKlaus Kämpf <kkaempf@suse.de>2010-11-13 17:35:04 +0100
commit5fb5bfe9a2e8247f21449d0112eeb2951b73dfc9 (patch)
treea641c381b4d49fcccf247ca86b00b88c64f91842
parent1b81c2fed0efcc0063a608c52ef4344c146da0ba (diff)
downloadlibzypp-bindings-5fb5bfe9a2e8247f21449d0112eeb2951b73dfc9.tar.gz
libzypp-bindings-5fb5bfe9a2e8247f21449d0112eeb2951b73dfc9.tar.bz2
libzypp-bindings-5fb5bfe9a2e8247f21449d0112eeb2951b73dfc9.zip
Extract ZYPP_VERSION from .so symlink
-rw-r--r--CMakeLists.txt14
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 63c2ebb..c24a4a8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -46,7 +46,19 @@ FIND_PACKAGE(SWIG REQUIRED)
FIND_PACKAGE(Zypp REQUIRED)
-SET( SWIG_DEFINITIONS -DZYPP_DEPRECATED )
+# determine zypp version
+EXECUTE_PROCESS(COMMAND "/usr/bin/readlink" ${ZYPP_LIBRARY} OUTPUT_VARIABLE ZYPP_SOFILE)
+
+# match number at end, strip trailing \n by using a sub-match
+STRING(REGEX MATCH "([0-9]+)\n$" ZYPP_VERSION "${ZYPP_SOFILE}")
+SET( ZYPP_VERSION "${CMAKE_MATCH_1}" )
+MESSAGE(STATUS "Zypp so library: ${ZYPP_SOFILE}, version ${ZYPP_VERSION}")
+
+SET( SWIG_DEFINITIONS -DZYPP_DEPRECATED -DZYPP_VERSION=${ZYPP_VERSION} )
+
+#
+# Finding Boost
+#
FIND_PATH( BOOST_SMARTPTR_INCLUDE_DIR boost/smart_ptr/shared_ptr.hpp
/usr/include