aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-08-20 18:59:03 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-08-29 18:08:59 +0200
commit2291c75ab0ebdaff43178658304ca79856ff238d (patch)
tree423a5f8af2158fb23daa73a330f15f61de80ac05 /cmake
parent77b4801e1164292082ad12b90fadb4e47fd7b0c8 (diff)
downloadlibssh-2291c75ab0ebdaff43178658304ca79856ff238d.tar.gz
libssh-2291c75ab0ebdaff43178658304ca79856ff238d.tar.xz
libssh-2291c75ab0ebdaff43178658304ca79856ff238d.zip
cmake: Detect abimap version
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/Modules/FindABIMap.cmake16
1 files changed, 15 insertions, 1 deletions
diff --git a/cmake/Modules/FindABIMap.cmake b/cmake/Modules/FindABIMap.cmake
index 6824eee9..7396c2fd 100644
--- a/cmake/Modules/FindABIMap.cmake
+++ b/cmake/Modules/FindABIMap.cmake
@@ -235,8 +235,22 @@ if (PYTHONINTERP_FOUND)
" (try `pip install abimap`)")
endif ()
+ if (ABIMAP_EXECUTABLE)
+ # Get the abimap version
+ execute_process(COMMAND ${ABIMAP_EXECUTABLE} version
+ OUTPUT_VARIABLE ABIMAP_VERSION_STRING
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ # If the version string starts with abimap-, strip it
+ if ("abimap" STRLESS_EQUAL ${ABIMAP_VERSION_STRING})
+ string(REGEX REPLACE "abimap-" "" ABIMAP_VERSION_STRING "${ABIMAP_VERSION_STRING}")
+ endif()
+ endif()
+
include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(ABIMap REQUIRED_VARS ABIMAP_EXECUTABLE)
+ find_package_handle_standard_args(ABIMap
+ REQUIRED_VARS ABIMAP_EXECUTABLE
+ VERSION_VAR ABIMAP_VERSION_STRING)
endif()