From ec5cc80643149139e4f4b394607ce28ed7c0a1e8 Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Thu, 21 Jan 2021 11:39:01 +0100 Subject: [PATCH] Properly fill graphviz_version.h 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 | 1 + CMakeLists.txt | 5 +++-- rtest/test_regression.py | 8 +------- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b71872145..bbcc21477 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 923e111d2..a67cf784a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/rtest/test_regression.py b/rtest/test_regression.py index 15f691f11..78da3fd4d 100644 --- a/rtest/test_regression.py +++ b/rtest/test_regression.py @@ -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]) -- 2.40.0