Merge pull request #1591 from theopolis/fix_ubuntu12_dpkg

Fix Ubuntu12 libdpkg version discovery
This commit is contained in:
Teddy Reed 2015-10-19 17:21:56 -07:00
commit 7ca9ae89be

View File

@ -9,12 +9,10 @@
find_package(PkgConfig QUIET)
pkg_check_modules(PC_LIBDPKG QUIET libdpkg)
MESSAGE("LOG" ${PC_LIBDPKG_LIBRARY_DIRS})
set(LIBDPKG_VERSION ${PC_LIBDPKG_VERSION})
string(REGEX REPLACE "([0-9]+).[0-9]+.[0-9]+" "\\1" LIBDPKG_VERSION_MAJOR ${LIBDPKG_VERSION})
string(REGEX REPLACE "[0-9]+.([0-9]+).[0-9]+" "\\1" LIBDPKG_VERSION_MINOR ${LIBDPKG_VERSION})
string(REGEX REPLACE "[0-9]+.[0-9]+.([0-9]+)" "\\1" LIBDPKG_VERSION_PATCH ${LIBDPKG_VERSION})
string(REGEX REPLACE "([0-9]+).[0-9]+.[0-9]+.*" "\\1" LIBDPKG_VERSION_MAJOR ${LIBDPKG_VERSION})
string(REGEX REPLACE "[0-9]+.([0-9]+).[0-9]+.*" "\\1" LIBDPKG_VERSION_MINOR ${LIBDPKG_VERSION})
string(REGEX REPLACE "[0-9]+.[0-9]+.([0-9]+).*" "\\1" LIBDPKG_VERSION_PATCH ${LIBDPKG_VERSION})
math(EXPR LIBDPKG_VERSION_NUMBER "${LIBDPKG_VERSION_MAJOR} * 1000000 + ${LIBDPKG_VERSION_MINOR} * 1000 + ${LIBDPKG_VERSION_PATCH}")
include(FindPackageHandleStandardArgs)