diff options
author | albert-github <albert.tests@gmail.com> | 2020-05-15 11:47:20 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2020-05-15 11:47:20 (GMT) |
commit | a93deafa9c460aceb9ca87add52405e1f41cf14a (patch) | |
tree | 351e52d4a5e8ee9777c5dc96d1cad296f627b289 | |
parent | fe16aedd32137828fb0ab9cdd68ef043e17c59ee (diff) | |
download | Doxygen-a93deafa9c460aceb9ca87add52405e1f41cf14a.zip Doxygen-a93deafa9c460aceb9ca87add52405e1f41cf14a.tar.gz Doxygen-a93deafa9c460aceb9ca87add52405e1f41cf14a.tar.bz2 |
Change of git version input file was not taken into account
Changes in the git version input file file were not taken into account. Explicitly checking whether or not the input file is newer or not than the output file.
-rw-r--r-- | cmake/git_watcher.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/cmake/git_watcher.cmake b/cmake/git_watcher.cmake index 72b7852..ac34c1d 100644 --- a/cmake/git_watcher.cmake +++ b/cmake/git_watcher.cmake @@ -150,6 +150,19 @@ function(CheckGit _working_dir _state_changed _state) # (Passing by reference in CMake is awkward...) set(${_state} ${state} PARENT_SCOPE) + if(EXISTS "${POST_CONFIGURE_GIT_VERSION_FILE}") + if("${PRE_CONFIGURE_GIT_VERSION_FILE}" IS_NEWER_THAN "${POST_CONFIGURE_GIT_VERSION_FILE}") + file(REMOVE "${POST_CONFIGURE_GIT_VERSION_FILE}") + file(REMOVE "${GIT_STATE_FILE}") + set(${_state_changed} "true" PARENT_SCOPE) + return() + endif() + else() + file(REMOVE "${GIT_STATE_FILE}") + set(${_state_changed} "true" PARENT_SCOPE) + return() + endif() + # Check if the state has changed compared to the backup on disk. if(EXISTS "${GIT_STATE_FILE}") file(READ "${GIT_STATE_FILE}" OLD_HEAD_CONTENTS) |