On the disk I have a file VERSION
with in it the version number this is used in CMakeLists.txt
means of
include(version)
where the version.cmake
has as content:
file (STRINGS "${TOP}/VERSION" VERSION)
set(ENV{VERSION} "${VERSION}")
The so created environment variable used is later on by means of:
add_custom_target(run_doxygen
COMMAND ${CMAKE_COMMAND} -E env VERSION=${VERSION} ${THE_EXECUTABLE}
)
(with also setting some dependencies and the working directory).
So far so good, though when just changing the value in the VERSION
file, the value of the environment variable is not changed, it is first changed when one of the cmake files is changed (the cmake configuration step is rerun at that moment).
How to overcome this problem?