From 6e05aff3bfb4ac7c54ef31f874ddc1c2c0bef4f3 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Tue, 23 Nov 2021 10:37:37 -0500 Subject: [PATCH] Update CMake utility function get_lammps_version() With the introduction of LAMMPS_UPDATE, version.h is no longer a single line file. With this change the CMake utility will only process the LAMMPS_VERSION line. Fixes issue #3038 --- cmake/Modules/LAMMPSUtils.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Modules/LAMMPSUtils.cmake b/cmake/Modules/LAMMPSUtils.cmake index 28ad99fa31..943c3d851e 100644 --- a/cmake/Modules/LAMMPSUtils.cmake +++ b/cmake/Modules/LAMMPSUtils.cmake @@ -25,7 +25,7 @@ function(validate_option name values) endfunction(validate_option) function(get_lammps_version version_header variable) - file(READ ${version_header} line) + file(STRINGS ${version_header} line REGEX LAMMPS_VERSION) set(MONTHS x Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\1" day "${line}") string(REGEX REPLACE "#define LAMMPS_VERSION \"([0-9]+) ([A-Za-z]+) ([0-9]+)\"" "\\2" month "${line}")