#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015, 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.
if(REGRESSIONTEST_DOWNLOAD)
if("${PROJECT_VERSION}" MATCHES "-dev")
set(REGRESSIONTEST_URL http://gerrit.gromacs.org/snapshot/${REGRESSIONTEST_BRANCH})
- set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/regressiontests"
- CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+ # REGRESSIONTEST_PATH for dev trees is set later based on the dirname found in the tar
else()
set(REGRESSIONTEST_URL http://gerrit.gromacs.org/download/regressiontests-${REGRESSIONTEST_VERSION}.tar.gz)
set(REGRESSIONTEST_PATH
if(NOT ${REGRESSIONTEST_MD5SUM} STREQUAL ${COMPUTED_MD5SUM})
message(FATAL_ERROR "Download of regressiontests failed. Expected MD5 of ${REGRESSIONTEST_MD5SUM} but download has ${COMPUTED_MD5SUM}")
endif()
+ else()
+ # Extract the REGRESSIONTEST_PATH from the tar when using dev tree.
+ execute_process(COMMAND ${CMAKE_COMMAND} -E tar tf "${REGRESSIONTEST_FILE}"
+ RESULT_VARIABLE _tar_tf_res
+ OUTPUT_VARIABLE _tar_tf_out)
+ if (${_tar_tf_res} EQUAL 0)
+ string(REGEX REPLACE "/\n.*$" "" _regressiontest_dir "${_tar_tf_out}")
+ set(REGRESSIONTEST_PATH "${CMAKE_CURRENT_BINARY_DIR}/${_regressiontest_dir}"
+ CACHE PATH "Path to auto-downloaded regressiontests" FORCE)
+ else()
+ message(FATAL_ERROR "Failed to list the contents of the downloaded tarball: ${REGRESSIONTEST_FILE}")
+ endif()
endif()
file(REMOVE_RECURSE "${REGRESSIONTEST_PATH}") #delete potential prior folder