diff options
author | albert-github <albert.tests@gmail.com> | 2019-05-31 18:03:45 (GMT) |
---|---|---|
committer | albert-github <albert.tests@gmail.com> | 2019-05-31 18:03:45 (GMT) |
commit | 4ad23e5d18fc294e00844fd8557f8c5dd6254d6e (patch) | |
tree | 54add50b60dc75b677dc62afc84aad4014b0d9a2 /libversion/CMakeLists.txt | |
parent | fa9dda01e6c013c7fe9be99b21d8bbf3c95c0482 (diff) | |
download | Doxygen-4ad23e5d18fc294e00844fd8557f8c5dd6254d6e.zip Doxygen-4ad23e5d18fc294e00844fd8557f8c5dd6254d6e.tar.gz Doxygen-4ad23e5d18fc294e00844fd8557f8c5dd6254d6e.tar.bz2 |
Show git version information
The original version has as features:
- getting the git version number for usage in doxygen
- making the doxygen version number inclusion dependent on the VERSION file
The disadvantage of the chosen methodology was that an extra correction step was necessary, by defining getter methods to retrieve the values this correction can be hidden.
The information is coming from different sources:
- the VERSION file
- the git "repository and build system (when present)
Furthermore there are a couple of places where the version information is used (a.o. doxygen and doxywizard executable, though the doxygenwizard was only done "half hearted")
The handling of the VERSION file has been made in such a way that it is comparable with the generation of the git version changes.
For a better abstraction the version handling is all done in a separate directory.
Diffstat (limited to 'libversion/CMakeLists.txt')
-rw-r--r-- | libversion/CMakeLists.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/libversion/CMakeLists.txt b/libversion/CMakeLists.txt new file mode 100644 index 0000000..1a430fd --- /dev/null +++ b/libversion/CMakeLists.txt @@ -0,0 +1,27 @@ +# vim:ts=4:sw=4:expandtab:autoindent: + +# setup information for doxygen version handling +set(PRE_CONFIGURE_DOXYGEN_VERSION_FILE "${CMAKE_SOURCE_DIR}/libversion/doxyversion.cpp.in") +set(POST_CONFIGURE_DOXYGEN_VERSION_FILE "${GENERATED_SRC}/doxyversion.cpp") + +# setup information for git version handling +set(PRE_CONFIGURE_GIT_VERSION_FILE "${CMAKE_SOURCE_DIR}/libversion/gitversion.cpp.in") +set(POST_CONFIGURE_GIT_VERSION_FILE "${GENERATED_SRC}/gitversion.cpp") + +include(${CMAKE_SOURCE_DIR}/cmake/git_watcher.cmake) +include(${CMAKE_SOURCE_DIR}/cmake/doxygen_version.cmake) + +include_directories( + . +) + +add_library(version STATIC + ${POST_CONFIGURE_DOXYGEN_VERSION_FILE} + ${POST_CONFIGURE_GIT_VERSION_FILE} +) + +add_dependencies( version check_git_repository ) +add_dependencies( version check_doxygen_version ) + +set_source_files_properties(${POST_CONFIGURE_GIT_VERSION_FILE} PROPERTIES GENERATED 1) +set_source_files_properties(${POST_CONFIGURE_DOXYGEN_VERSION_FILE} PROPERTIES GENERATED 1) |