From 90b0c3927f7a93a14ff6b366d018a5a905ee906a Mon Sep 17 00:00:00 2001 From: Giacomo Fiorin Date: Tue, 12 Dec 2023 10:43:19 -0500 Subject: [PATCH] Allow detecting OpenMM source tree in parent folder (convenience check) --- devel-tools/build_test_library.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/devel-tools/build_test_library.cmake b/devel-tools/build_test_library.cmake index e0b1484b8..eea8eb046 100644 --- a/devel-tools/build_test_library.cmake +++ b/devel-tools/build_test_library.cmake @@ -55,6 +55,12 @@ if(COLVARS_LEPTON) if(NOT DEFINED LEPTON_DIR) set(LEPTON_DIR "${COLVARS_SOURCE_DIR}/openmm-source/libraries/lepton") if(NOT EXISTS ${LEPTON_DIR}) + # Try the parent folder + get_filename_component(LEPTON_DIR ${COLVARS_SOURCE_DIR} DIRECTORY) + set(LEPTON_DIR "${LEPTON_DIR}/openmm-source/libraries/lepton") + endif() + if(NOT EXISTS ${LEPTON_DIR}) + # Giving up, cloning OpenMM execute_process(COMMAND git clone --depth=1 https://github.com/openmm/openmm.git "${COLVARS_SOURCE_DIR}/openmm-source") endif() message(STATUS "Using Lepton library from: ${LEPTON_DIR}")