]> granicus.if.org Git - graphviz/commitdiff
Properly fill graphviz_version.h
authorKevin Funk <kfunk@kde.org>
Thu, 21 Jan 2021 10:39:01 +0000 (11:39 +0100)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 6 Feb 2021 18:54:07 +0000 (10:54 -0800)
Make sure the variables used inside the header template are populated.

Prior to this patch we ended up with this in the generated
graphviz_version.h:
  #define PACKAGE_VERSION ""

Edit by Matthew Fernandez: Added changelog entry and flipped polarity on the
CMake test case for this.

CHANGELOG.md
CMakeLists.txt
rtest/test_regression.py

index b71872145685db638aa56711b6e3efeaa097fe34..bbcc21477608a5e27d8004910b0fccedee9f2d3a 100644 (file)
@@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 - Offer .tar.xz files too #454
 - Header file graphviz_version.h has no include guards #1929
 - regression: newlines embedded in quoted labels / node names are not preserved in 2.46.0 #1931
+- Properly fill graphviz_version.h !1706
 
 ## [2.46.0] - 2021-01-18
 
index 923e111d2cc463dd836df93d64ec649d82b9c667..a67cf784a08b57636ba1a807588a0b0157a78462 100644 (file)
@@ -104,8 +104,6 @@ if (WIN32)
 endif()
 
 # ============================ Set Graphviz version ============================
-configure_file(graphviz_version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/graphviz_version.h @ONLY)
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/graphviz_version.h DESTINATION ${HEADER_INSTALL_DIR})
 
 if (DEFINED VERSION)
     set(GRAPHVIZ_VERSION_STRING "${VERSION}")
@@ -155,6 +153,9 @@ string(REGEX REPLACE "[^.]*\\.[^.]*\\.(.*)$"
 set(GRAPHVIZ_VERSION_FULL "${GRAPHVIZ_VERSION_STRING}")
 file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/builddate.h "#define BUILDDATE \"${GRAPHVIZ_VERSION_BUILD}\"")
 
+configure_file(graphviz_version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/graphviz_version.h @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/graphviz_version.h DESTINATION ${HEADER_INSTALL_DIR})
+
 message(STATUS "Graphviz version: ${GRAPHVIZ_VERSION_FULL}")
 
 include(config_checks)
index 15f691f11f54a4bc437fb35d63c8dcb027e55664..78da3fd4d0d70c8549dbeb71e7e583bb26d25927 100644 (file)
@@ -779,10 +779,4 @@ def test_package_version():
           subprocess.check_call([cc, '-std=c99', c_src, '-o', exe])
 
       # run the test
-      ret = subprocess.call([exe])
-
-    # FIXME: this is currently broken in the CMake build
-    if os.getenv('build_system') == 'cmake':
-      assert ret != 0
-    else:
-      assert ret == 0
+      subprocess.check_call([exe])