Merge pull request #538 from ggrtk/scmversion

CMake: Always run gen_scmversion script on rebuilds
This commit is contained in:
Connor McLaughlin 2020-06-07 19:14:43 +10:00 committed by GitHub
commit abc627de9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -1,9 +1,10 @@
# _scmversion.cpp is a dummy file that will never be created, so the command will always be run
if(WIN32) 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" COMMAND cmd /k "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.bat"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}") WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}")
else() else()
add_custom_command(OUTPUT scmversion.cpp add_custom_command(OUTPUT scmversion.cpp _scmversion.cpp
COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.sh") COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/gen_scmversion.sh")
endif() endif()