forked from osmocom/wireshark
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.pespin/rlcmac
parent
e81a400edb
commit
ffcfc83ecb
|
@ -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}" )
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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})
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <zlib.h>
|
||||
#endif
|
||||
|
||||
#include "version.h"
|
||||
#include "vcs_version.h"
|
||||
|
||||
#include "version_info.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue