From 2490618d0a73fbcc8f55013664a7358eacc800b8 Mon Sep 17 00:00:00 2001 From: Albert Liu <45282415+ggrtk@users.noreply.github.com> Date: Sat, 6 Jun 2020 22:55:15 -0700 Subject: [PATCH] CMake: Always run gen_scmversion script on rebuilds Fixes issue where scmversion.cpp would not be regenerated with updated Git info on rebuilds, causing an outdated version to be displayed in window titles. --- src/scmversion/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scmversion/CMakeLists.txt b/src/scmversion/CMakeLists.txt index cc3a234d4..873c683e4 100644 --- a/src/scmversion/CMakeLists.txt +++ b/src/scmversion/CMakeLists.txt @@ -1,9 +1,10 @@ +# _scmversion.cpp is a dummy file that will never be created, so the command will always be run if(WIN32) - add_custom_command(OUTPUT scmversion.cpp + add_custom_command(OUTPUT scmversion.cpp _scmversion.cpp COMMAND cmd /k "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.bat" WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") else() - add_custom_command(OUTPUT scmversion.cpp + add_custom_command(OUTPUT scmversion.cpp _scmversion.cpp COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.sh") endif()