From 2b891fd1eb94613b24f2fd608773330fa115c66c Mon Sep 17 00:00:00 2001 From: Markus Frosch Date: Thu, 25 Jul 2019 10:49:11 +0200 Subject: [PATCH] cmake: Improve ICINGA2_VERSION_SAFE for pre-releases --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29bc81838..735e553f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,8 @@ endif() # NuGet on Windows requires a semantic versioning, example: 2.10.4.123 (only 4 element, only numeric) string(REGEX REPLACE "-([0-9]+).*$" ".\\1" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION}") +string(REGEX REPLACE "-[^\\.]*(.*)$" "\\1" ICINGA2_VERSION_SAFE "${ICINGA2_VERSION_SAFE}") +message(STATUS "ICINGA2_VERSION_SAFE=${ICINGA2_VERSION_SAFE}") if(WIN32) set(Boost_USE_STATIC_LIBS ON)