#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2014, by the GROMACS development team, led by
+# Copyright (c) 2014,2016, 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.
# More flexible alternative to add_custom_command() and add_custom_target()
# for dependent custom commands. It adds a few convenience features:
-# - Support for custom commands that always run (like add_custom_target()),
-# but still have the ability to act as dependencies of other custom
-# commands (such that the dependent commands run only if the output
-# has been updated) also for Ninja.
# - Adds file-level dependencies between custom targets added with this
# command such that if there is a target-level dependency, it also implies
# that the custom command should always be run if the output file of the
# [WORKING_DIRECTORY <dir>]
# [DEPENDS <deps...>]
# [DEPENDS_FILE_LIST <list>]
-# [COMMENT <comment>])
+# [COMMENT <comment>] [USES_TERMINAL])
#
# <target>
# - Name of the custom target to create.
# RUN_ALWAYS
-# - Create the command such that it always runs.
-# This takes care of differences between the Ninja generator and others,
-# which require different rules to make this happen such that
-# dependencies on the output of the target work correctly, also in the
-# case the command does not always update the timestamp of the output.
+# - Create the command such that it always runs, and may update the output
+# file in the process.
# The dependencies listed with DEPENDS are ignored in this case.
# ADD_FAST_TARGET
# - In addition to creating <target>, create a secondary target
# - Passed to add_custom_command()/add_custom_target()
# COMMENT
# - Passed to add_custom_command()/add_custom_target()
+# USES_TERMINAL
+# - Passed to add_custom_command()/add_custom_target()
# DEPENDS
# - Dependencies passed to add_custom_command(). Any targets in this list
# that have been created with gmx_add_custom_output_target() are
set(_add_fast ON)
elseif ("x${_arg}" MATCHES "^x(OUTPUT|DEPENDS|DEPENDS_FILE_LIST)$")
set(_option ${_arg})
- elseif ("x${_arg}" MATCHES "^x(COMMAND|COMMENT|WORKING_DIRECTORY)$")
+ elseif ("x${_arg}" MATCHES "^x(COMMAND|COMMENT|WORKING_DIRECTORY|USES_TERMINAL)$")
set(_option "PASS")
list(APPEND _command_args "${_arg}")
elseif ("x${_option}" STREQUAL "xDEPENDS")
endif()
# Create the actual command as requested.
if (NOT _always)
- # If the command does not need to run always, the standard CMake
- # mechanism is sufficient.
add_custom_command(OUTPUT ${_output}
${_command_args} DEPENDS ${_deps} VERBATIM)
add_custom_target(${targetname} DEPENDS ${_output})
- elseif (CMAKE_GENERATOR STREQUAL "Ninja")
- # Ninja requires all generated files mentioned in dependencies of custom
- # commands to be actually mentioned in the build system, and luckily
- # add_custom_command() makes that possible.
- # But it seems impossible to create a robust custom command that would be
- # always run, so other generators that do not have this constraint simply
- # use an add_custom_target().
- #
- # The second, phony file is never created, so the rule is always
- # triggered again. TODO: Figure out why this works, even though ninja
- # very eagerly complains about missing files.
- # This unfortunately does not work with the make generator, as
- # the non-existent second file causes some part of the generated system
- # erase the first file at the beginning of every build, causing a full
- # rebuild of the dependencies.
- add_custom_command(OUTPUT ${_output} ${targetname}-phony
- ${_command_args} VERBATIM)
- # The generated Ninja build system would probably work fine even
- # without this target, but CMake requires all custom commands to belong
- # to a target in the same CMakeLists.txt to generate anything for them.
- add_custom_target(${targetname} DEPENDS ${_output})
else()
- # For other generators, a target-level dependency on the custom target
- # ensures that the output is created before the dependent targets'
- # dependencies are even evaluated.
- add_custom_target(${targetname} ${_command_args} VERBATIM)
+ add_custom_target(${targetname} BYPRODUCTS ${_output}
+ ${_command_args} VERBATIM)
endif()
# Store the output file name in a custom property to be used in dependency
# resolution later.
# The main interface to this machinery is the gmx_configure_version_file()
# CMake function. The signature is
# gmx_configure_version_file(<input> <output>
-# [REMOTE_HASH] [SOURCE_FILE]
+# [REMOTE_HASH]
# [TARGET <target>]
# [COMMENT <comment>])
# <input> Specify the input and output files as for configure_file().
# This variable is much more expensive to initialize than the
# others, so this allows local changes in this file to only
# compute that value when required if that becomes necessary.
-# SOURCE_FILE Signals that <output> will be used as a source file.
-# The function will set properties for the source file
-# appropriately to signify that it is generated.
# TARGET By default, this function uses add_custom_command() to
# generate the output file. If TARGET is specified, then
# add_custom_target() is used to create a target with the given
endif()
set(REGRESSIONTEST_VERSION "${GMX_VERSION_STRING}")
-set(REGRESSIONTEST_BRANCH "refs/heads/release-2016")
+set(REGRESSIONTEST_BRANCH "refs/heads/master")
# TODO Find some way of ensuring that this is bumped appropriately for
# each release. It's hard to test because it is only used for
# REGRESSIONTEST_DOWNLOAD, which doesn't work until that tarball has
# been placed on the server.
-set(REGRESSIONTEST_MD5SUM "366438549270d005fa6def6e56ca0256" CACHE INTERNAL "MD5 sum of the regressiontests tarball")
+set(REGRESSIONTEST_MD5SUM "366438549270d005fa6def6e56ca0256")
math(EXPR GMX_VERSION_NUMERIC
"${GMX_VERSION_MAJOR}*10000 + ${GMX_VERSION_PATCH}")
# See documentation at the top of the script.
function (gmx_configure_version_file INFILE OUTFILE)
include(CMakeParseArguments)
- set(_options REMOTE_HASH SOURCE_FILE)
+ set(_options REMOTE_HASH)
set(_one_value_args COMMENT TARGET)
set(_multi_value_args EXTRA_VARS)
cmake_parse_arguments(
add_custom_target(${ARG_TARGET} DEPENDS ${OUTFILE} VERBATIM)
gmx_set_custom_target_output(${ARG_TARGET} ${OUTFILE})
endif()
- if (ARG_SOURCE_FILE)
- set_source_files_properties(${OUTFILE} PROPERTIES GENERATED true)
- endif()
endfunction()
#
# This file is part of the GROMACS molecular simulation package.
#
-# Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
+# Copyright (c) 2012,2013,2014,2015,2016, 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.
COMMAND ${CMAKE_COMMAND} -DDOCTYPE=${TYPE} -P RunDoxygen.cmake
DEPENDS ${_deps}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "${COMMENT}")
+ COMMENT "${COMMENT}" USES_TERMINAL)
if (_fast_arg)
add_dependencies(${TARGET}-fast doxygen-version)
endif()
${CMAKE_CURRENT_SOURCE_DIR}/gmxtree.py
${CMAKE_CURRENT_SOURCE_DIR}/graphbuilder.py
${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt
- COMMENT "Generating include dependency graphs for dot")
+ COMMENT "Generating include dependency graphs for dot"
+ USES_TERMINAL)
# Add separate targets for converting the .dot files to .png.
# These are not needed by the Doxygen targets, but are useful for
--ignore ${CMAKE_CURRENT_SOURCE_DIR}/suppressions.txt
--ignore-cycles ${CMAKE_CURRENT_SOURCE_DIR}/cycle-suppressions.txt)
add_custom_target(check-source COMMAND ${check_source_command}
- COMMENT "Checking source code for various issues" VERBATIM)
+ COMMENT "Checking source code for various issues" VERBATIM USES_TERMINAL)
add_custom_target(check-source-fast COMMAND ${check_source_command}
- COMMENT "Checking source code for various issues" VERBATIM)
+ COMMENT "Checking source code for various issues" VERBATIM USES_TERMINAL)
add_dependencies(check-source doxygen-xml)
endif()
else()