Fix checksumming code
authorPaul Bauer <paul.bauer.q@gmail.com>
Tue, 19 Jan 2021 09:17:49 +0000 (10:17 +0100)
committerArtem Zhmurov <zhmurov@gmail.com>
Wed, 20 Jan 2021 05:11:24 +0000 (05:11 +0000)
Recent additions to the code to avoid errors with certain IDEs
caused issues by never trying to validate the checksums.

Fixed by properly passing the necessary variables to the script.

Fixes #3862

cmake/gmxGenerateVersionInfoWithoutGit.cmake
cmake/gmxVersionInfo.cmake

index 68b9c6fafaae35f73a191551200a539e7ab526e3..72b85bcc66842d020e6e3982d7d75b4c30a3d5fa 100644 (file)
@@ -1,7 +1,7 @@
 #
 # This file is part of the GROMACS molecular simulation package.
 #
-# Copyright (c) 2020, by the GROMACS development team, led by
+# Copyright (c) 2020,2021, by the GROMACS development team, led by
 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
 # and including many others, as listed in the AUTHORS file in the
 # top-level source directory and at http://www.gromacs.org.
 # GEN_VERSION_INFO_INTERNAL has to be set ON.
 #
 # The following variables have to be previously defined:
-# PROJECT_VERSION         - hard-coded version string (generated info is appended)
-# PROJECT_SOURCE_DIR      - top level source directory
-# DIRECTORIES_TO_CHECKSUM - List of directories to hash
-# VERSION_CMAKEIN         - path to an input template file
-# VERSION_OUT             - path to the output file
+# PROJECT_VERSION               - hard-coded version string (generated info is appended)
+# PROJECT_SOURCE_DIR            - top level source directory
+# SOURCE_IS_SOURCE_DISTRIBUTION - Whether we are building from source or tarball
+# DIRECTORIES_TO_CHECKSUM       - List of directories to hash
+# VERSION_CMAKEIN               - path to an input template file
+# VERSION_OUT                   - path to the output file
 #
 # The following a possible additional definitions
-# PYTHON_EXECUTABLE       - Needed to run checking stage of current tree
-# VERSION_STRING_OF_FORK  - Possibly defined custom version string to override
-#                          process of checking source file hashes.
+# PYTHON_EXECUTABLE             - Needed to run checking stage of current tree
+# VERSION_STRING_OF_FORK        - Possibly defined custom version string to override
+#                                 process of checking source file hashes.
 # Output:
 # VERSION_OUT is configured from the input VERSION_CMAKEIN
 # using the variables listed below.
@@ -81,6 +82,9 @@ endif()
 if ("${VERSION_OUT}" STREQUAL "")
     message(FATAL_ERROR "Missing input parameter VERSION_OUT!")
 endif()
+if ("${SOURCE_IS_SOURCE_DISTRIBUTION}" STREQUAL "")
+    message(FATAL_ERROR "SOURCE_IS_SOURCE_DISTRIBUTION undefined!")
+endif()
 
 # Prepare version string to populate
 set(GMX_VERSION_STRING_FULL          ${PROJECT_VERSION})
index 33cd58ead04eb27c94aa3387d4272187fb353305..bd0ad216fef48666e9408c62215b452feb4b34f6 100644 (file)
@@ -411,6 +411,7 @@ else()
             -D VERSION_CMAKEIN=${VERSION_INFO_CMAKEIN_FILE_PARTIAL}
             -D VERSION_OUT=${VERSION_INFO_CMAKE_FILE}
             -D VERSION_STRING_OF_FORK=${GMX_VERSION_STRING_OF_FORK}
+            -D SOURCE_IS_SOURCE_DISTRIBUTION=${SOURCE_IS_SOURCE_DISTRIBUTION}
             -P ${CMAKE_CURRENT_LIST_DIR}/gmxGenerateVersionInfoWithoutGit.cmake
         WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
         COMMENT "Generating release version information")