From 7c895b75068b037d2abb36fa9d88bd87847aa641 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Wed, 23 Mar 2022 09:27:33 +0100 Subject: [PATCH] Run gen-versioninfo unconditionally (#8368) This fixes an issue where the output of `--show-config` would not be updated properly in certain cases (e.g., when files were modified but cmake is not run). We now run the `gen-versioninfo` target unconditionally, always updating the `versioninfo.cpp` where the version data for `--show-config` is stored. --- cmake/version.cmake | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/cmake/version.cmake b/cmake/version.cmake index 183fe213b..87ba19933 100644 --- a/cmake/version.cmake +++ b/cmake/version.cmake @@ -25,19 +25,11 @@ if(CMAKE_SCRIPT_MODE_FILE) else() # was run within the overall cmake project # add target to update versioninfo.cpp at build time - add_custom_command( - OUTPUT - ${CMAKE_BINARY_DIR}/src/base/versioninfo.cpp + add_custom_target(gen-versioninfo COMMAND ${CMAKE_COMMAND} -DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR} -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${PROJECT_SOURCE_DIR}/cmake/version.cmake - DEPENDS - ${PROJECT_SOURCE_DIR}/cmake/version-base.cmake - ${PROJECT_SOURCE_DIR}/cmake/version.cmake - ) - add_custom_target(gen-versioninfo - DEPENDS ${CMAKE_BINARY_DIR}/src/base/versioninfo.cpp ) endif() -- 2.30.2