diff --git a/gromacs/CMakeLists.txt.diff b/gromacs/CMakeLists.txt.diff index bcfa2b1dc..84b281819 100644 --- a/gromacs/CMakeLists.txt.diff +++ b/gromacs/CMakeLists.txt.diff @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 70b0369bed..cccfe2aa1b 100644 +index 3681e50c8c..108c35e8f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -678,6 +678,8 @@ include(gmxManageLmfit) +@@ -684,6 +684,8 @@ include(gmxManageLmfit) include(gmxManageMuparser) @@ -10,4 +10,4 @@ index 70b0369bed..cccfe2aa1b 100644 + include(gmxManageColvars) - ################################################## + include(gmxManagePlumed) diff --git a/update-colvars-code.sh b/update-colvars-code.sh index ec826be20..0c237dd9d 100755 --- a/update-colvars-code.sh +++ b/update-colvars-code.sh @@ -619,14 +619,7 @@ then target_folder=${target}/src/external/colvars patch_opts="-p1 --forward -s" - echo "" - if [ -d ${target_folder} ] - then - echo "${target} source tree seems to have already been patched." - echo "Updating to the current Colvars sources." - else - mkdir ${target_folder} - fi + mkdir -p ${target_folder} # Copy library files and proxy files to the "src/external/colvars" folder for src in ${source}/src/*.h ${source}/src/*.cpp @@ -638,14 +631,19 @@ then # Patch CMake build recipe when applicable if [ -s ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff ] ; then - patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff + patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules/gmxManageColvars.cmake.diff || true fi - if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists1.txt.diff ] ; then - patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists1.txt.diff + if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists.txt.diff ] ; then + patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists.txt.diff || true fi - if [ -s ${source}/gromacs/gromacs-mdmodules/CMakeLists2.txt.diff ] ; then - patch -p1 -N -d ${target} < ${source}/gromacs/gromacs-mdmodules/CMakeLists2.txt.diff + if [ -s ${source}/gromacs/CMakeLists.txt.diff ] ; then + patch ${patch_opts} -d ${target} < ${source}/gromacs/CMakeLists.txt.diff || true fi + + if [ -s ${source}/gromacs/cmake/gmxManageColvars.cmake ] ; then + condcopy ${source}/gromacs/cmake/gmxManageColvars.cmake "${target}/cmake/gmxManageColvars.cmake" + fi + if [ -s ${source}/gromacs/cmake/gmxManageLepton.cmake ] ; then condcopy ${source}/gromacs/cmake/gmxManageLepton.cmake "${target}/cmake/gmxManageLepton.cmake" fi @@ -678,8 +676,8 @@ then echo "" # Apply patch for Gromacs files - if [ -f ${source}/gromacs/gromacs-mdmodules.patch ] ; then - patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules.patch + if [ -s ${source}/gromacs/gromacs-mdmodules.patch ] ; then + patch ${patch_opts} -d ${target} < ${source}/gromacs/gromacs-mdmodules.patch || true fi ret_val=$? if [ $ret_val -ne 0 ]