]> granicus.if.org Git - graphviz/commitdiff
Correct package version in CMake exe installer
authorMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 11 Aug 2020 07:36:59 +0000 (09:36 +0200)
committerMagnus Jacobsson <magnus.jacobsson@berotec.se>
Tue, 11 Aug 2020 09:00:27 +0000 (11:00 +0200)
Fixes https://gitlab.com/graphviz/graphviz/-/issues/1791

CMakeLists.txt

index ec26d3b5e0ed3fd1df91bb8fcc86e8451b546c94..63a493e24c2f5ba33bb691644f822e70459a7705 100644 (file)
@@ -135,6 +135,16 @@ else()
     endif()
 endif()
 
+string(REGEX REPLACE "\\..*"
+   "" GRAPHVIZ_VERSION_MAJOR
+   ${GRAPHVIZ_VERSION_STRING})
+string(REGEX REPLACE "[^.]*\\.([^.]*)\\..*"
+   "\\1" GRAPHVIZ_VERSION_MINOR
+   ${GRAPHVIZ_VERSION_STRING})
+string(REGEX REPLACE "[^.]*\\.[^.]*\\.(.*)$"
+   "\\1" GRAPHVIZ_VERSION_PATCH
+   ${GRAPHVIZ_VERSION_STRING})
+
 set(GRAPHVIZ_VERSION_FULL "${GRAPHVIZ_VERSION_STRING}")
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/builddate.h "#define BUILDDATE \"${GRAPHVIZ_VERSION_BUILD}\"")