build: Make sure cmake gets reconfigured when version file changes

This commit is contained in:
WerWolv 2022-09-06 10:43:43 +02:00
parent a0b2473bf4
commit ffbaef3872
1 changed files with 3 additions and 1 deletions

View File

@ -323,7 +323,9 @@ macro(setDefaultBuiltTypeIfUnset)
endmacro()
function(loadVersion version)
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION" read_version)
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/VERSION")
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${VERSION_FILE})
file(READ "${VERSION_FILE}" read_version)
set(${version} ${read_version} PARENT_SCOPE)
endfunction()