From ffcfc83ecb5e2591ccc11d1059250c69b285c331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Sat, 3 Jul 2021 14:26:30 +0100 Subject: [PATCH] Rename version.h to be more descriptive Version.h is too generic. This is specific to VCSVERSION and that should be made more obvious and discoverable. --- CMakeLists.txt | 8 ++++---- doc/README.developer | 2 +- packaging/rpm/wireshark.spec.in | 1 - tools/checklicenses.py | 2 +- tools/make-version.pl | 11 ++++++----- ui/CMakeLists.txt | 2 +- ui/version_info.c | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec75d09f81..12a9d940dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1623,16 +1623,16 @@ if(VCSVERSION_OVERRIDE) # Allow distributors to override detection of the Git tag and version. string(CONFIGURE "#define VCSVERSION \"@VCSVERSION_OVERRIDE@\"\n" _version_h_contents ESCAPE_QUOTES) - file(WRITE "${CMAKE_BINARY_DIR}/version.h" "${_version_h_contents}") + file(WRITE "${CMAKE_BINARY_DIR}/vcs_version.h" "${_version_h_contents}") message(STATUS "VCSVERSION_OVERRIDE: ${VCSVERSION_OVERRIDE}") else() - add_custom_target(version - BYPRODUCTS version.h + add_custom_target(vcs_version + BYPRODUCTS vcs_version.h COMMAND ${PERL_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/make-version.pl ${CMAKE_SOURCE_DIR} ) - set_target_properties(version PROPERTIES FOLDER "Auxiliary") + set_target_properties(vcs_version PROPERTIES FOLDER "Auxiliary") endif() set( configure_input "Built with CMake ${CMAKE_VERSION}" ) diff --git a/doc/README.developer b/doc/README.developer index 99108c7470..dacaca5d78 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -758,7 +758,7 @@ so your code won't even compile when warnings occur. 7. Miscellaneous notes Each commit in your branch corresponds to a different VCSVERSION string -automatically defined in the header 'version.h' during the build. If you happen +automatically defined in the header 'vcs_version.h' during the build. If you happen to find it convenient to disable this feature it can be done using: touch .git/wireshark-disable-versioning diff --git a/packaging/rpm/wireshark.spec.in b/packaging/rpm/wireshark.spec.in index 0b713be07f..c4cc41cdea 100644 --- a/packaging/rpm/wireshark.spec.in +++ b/packaging/rpm/wireshark.spec.in @@ -3,7 +3,6 @@ # says that recent CMake versions take care of rpathification. # To do: -# - Set version in version.h # - Add bcond_with clang %bcond_with ninja diff --git a/tools/checklicenses.py b/tools/checklicenses.py index 9927f947bd..c6f837795b 100755 --- a/tools/checklicenses.py +++ b/tools/checklicenses.py @@ -120,7 +120,7 @@ PATH_SPECIFIC_ALLOWED_LICENSES = { 'plugins/mate/mate_grammar.h': [ 'UNKNOWN', ], - 'version.h': [ + 'vcs_version.h': [ 'UNKNOWN', ], # Special IDL license that appears to be compatible as far as I (not a diff --git a/tools/make-version.pl b/tools/make-version.pl index fcccc8cb69..fd91521fae 100755 --- a/tools/make-version.pl +++ b/tools/make-version.pl @@ -12,10 +12,10 @@ # # If run with the "-r" or "--set-release" argument the VERSION macro in # CMakeLists.txt will have the version_extra template appended to the -# version number. version.h will _not_ be generated if either argument is +# version number. vcs_version.h will _not_ be generated if either argument is # present. # -# make-version.pl is called during the build to update version.h in the build +# make-version.pl is called during the build to update vcs_version.h in the build # directory. To set a fixed version, use something like: # # cmake -DVCSVERSION_OVERRIDE="Git v3.1.0 packaged as 3.1.0-1" @@ -42,7 +42,7 @@ my $tagged_version_extra = ""; my $untagged_version_extra = "-{vcsinfo}"; my $force_extra = undef; my $package_string = ""; -my $version_file = 'version.h'; +my $version_file = 'vcs_version.h'; my $vcs_name = "Git"; my $tortoise_file = "tortoise_template"; my $last_change = 0; @@ -135,7 +135,7 @@ sub read_repo_info { return; } - # Check whether to include VCS version information in version.h + # Check whether to include VCS version information in vcs_version.h if ($is_git_repo) { chomp($git_cdir = qx{git --git-dir="$src_dir/.git" rev-parse --git-common-dir 2> $devnull}); if ($git_cdir && -f "$git_cdir/wireshark-disable-versioning") { @@ -614,7 +614,7 @@ sub new_version_h # Don't change the file if it is not needed. # # XXX - We might want to add VCSVERSION to CMakeLists.txt so that it can -# generate version.h independently. +# generate vcs_version.h independently. sub print_VCS_REVISION { my $VCS_REVISION; @@ -686,6 +686,7 @@ sub get_config { "print-vcs", \$print_vcs, "set-version|v=s", \$set_version, "set-release|r", \$set_release, + "version-file|f", \$version_file, "verbose", \$verbose ) || pod2usage(2); diff --git a/ui/CMakeLists.txt b/ui/CMakeLists.txt index f3e0c6d3e6..0901eb7245 100644 --- a/ui/CMakeLists.txt +++ b/ui/CMakeLists.txt @@ -90,7 +90,7 @@ target_include_directories(ui SYSTEM add_library(version_info STATIC version_info.c) if(NOT VCSVERSION_OVERRIDE) - add_dependencies(version_info version) + add_dependencies(version_info vcs_version) endif() target_link_libraries(version_info PRIVATE ${ZLIB_LIBRARIES}) diff --git a/ui/version_info.c b/ui/version_info.c index b7e60cc381..2be9dca2b9 100644 --- a/ui/version_info.c +++ b/ui/version_info.c @@ -30,7 +30,7 @@ #include #endif -#include "version.h" +#include "vcs_version.h" #include "version_info.h"