From: Paul Bauer Date: Tue, 19 Jan 2021 09:17:49 +0000 (+0100) Subject: Fix checksumming code X-Git-Url: http://biod.pnpi.spb.ru/gitweb/?a=commitdiff_plain;h=01304e1920bfb5c781fcf7398445a82a2b89e055;p=alexxy%2Fgromacs.git Fix checksumming code 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 --- diff --git a/cmake/gmxGenerateVersionInfoWithoutGit.cmake b/cmake/gmxGenerateVersionInfoWithoutGit.cmake index 68b9c6fafa..72b85bcc66 100644 --- a/cmake/gmxGenerateVersionInfoWithoutGit.cmake +++ b/cmake/gmxGenerateVersionInfoWithoutGit.cmake @@ -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. @@ -42,16 +42,17 @@ # 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}) diff --git a/cmake/gmxVersionInfo.cmake b/cmake/gmxVersionInfo.cmake index 33cd58ead0..bd0ad216fe 100644 --- a/cmake/gmxVersionInfo.cmake +++ b/cmake/gmxVersionInfo.cmake @@ -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")