CMake: Deduplicate some version variables.

Use PROJECT_VERSION instead of VERSION. Prepend "PROJECT_" or
"LOG_PROJECT_" as needed to other variables. Remove the leftover unused
variables.
This commit is contained in:
Gerald Combs 2022-06-07 15:51:24 -07:00
parent 604cb2a7a3
commit c5e265f852
24 changed files with 56 additions and 60 deletions

View File

@ -352,12 +352,9 @@ else()
set(VERSION_FLAVOR "Development Build")
endif()
# These are required in .rc files and manifests
set(VERSION_MAJOR ${PROJECT_MAJOR_VERSION})
set(VERSION_MINOR ${PROJECT_MINOR_VERSION})
set(VERSION_MICRO ${PROJECT_PATCH_VERSION})
set(VERSION_BUILD ${PROJECT_BUILD_VERSION})
# Used in .rc files and manifests
set(RC_VERSION ${PROJECT_MAJOR_VERSION},${PROJECT_MINOR_VERSION},${PROJECT_PATCH_VERSION},${PROJECT_BUILD_VERSION})
set(LOG_RC_VERSION ${LOG_PROJECT_MAJOR_VERSION},${LOG_PROJECT_MINOR_VERSION},${PROJECT_PATCH_VERSION},${PROJECT_BUILD_VERSION})
message(STATUS "V: ${PROJECT_VERSION}, MaV: ${PROJECT_MAJOR_VERSION}, MiV: ${PROJECT_MINOR_VERSION}, PL: ${PROJECT_PATCH_VERSION}, EV: ${PROJECT_VERSION_EXTENSION}.")
@ -1688,7 +1685,6 @@ foreach(_plugin_src_dir ${PLUGIN_SRC_DIRS} ${LOGWOLF_PLUGIN_SRC_DIRS})
add_subdirectory( ${_plugin_src_dir} )
endforeach()
set( VERSION ${PROJECT_VERSION} )
if(VCSVERSION_OVERRIDE)
# Allow distributors to override detection of the Git tag and version.
string(CONFIGURE "#define VCSVERSION \"@VCSVERSION_OVERRIDE@\"\n"
@ -2182,7 +2178,7 @@ if(USE_REPOSITORY)
if(ZIP_EXECUTABLE)
add_custom_target(pdb_zip_package COMMENT "This packages .PDBs but will not create them.")
set_target_properties(pdb_zip_package PROPERTIES FOLDER "Packaging")
set(_pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${VERSION}.zip")
set(_pdb_zip "${CMAKE_BINARY_DIR}/Wireshark-pdb-${WIRESHARK_TARGET_PLATFORM}-${PROJECT_VERSION}.zip")
file(TO_NATIVE_PATH "${_pdb_zip}" _pdb_zip_win)
add_custom_command(TARGET pdb_zip_package POST_BUILD
COMMAND ${CMAKE_COMMAND} -E remove -f "${_pdb_zip}"
@ -3420,7 +3416,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()
string(REPLACE "-" "_" RPM_VERSION "${VERSION}")
string(REPLACE "-" "_" RPM_VERSION "${PROJECT_VERSION}")
configure_file(packaging/rpm/wireshark.spec.in ${CMAKE_BINARY_DIR}/packaging/rpm/SPECS/wireshark.spec)
if(RPMBUILD_EXECUTABLE)
foreach(_rpm_dir BUILD RPMS SOURCES SPECS SRPMS)

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "Wireshark"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = @VERSION@
PROJECT_NUMBER = @PROJECT_VERSION@
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Logwolf</string>
<key>CFBundleGetInfoString</key>
<string>@VERSION@, Copyright 1998-2022 Wireshark Development Team</string>
<string>@LOG_PROJECT_VERSION@, Copyright 1998-2022 Wireshark Development Team</string>
<key>CFBundleIconFile</key>
<string>Wireshark.icns</string>
<key>CFBundleIdentifier</key>
@ -34,11 +34,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<string>@LOG_PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>Lshk</string>
<key>CFBundleVersion</key>
<string>@VERSION@</string>
<string>@LOG_PROJECT_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 1998-2022 Wireshark Developers, GNU General Public License.</string>
<key>NSPrincipalClass</key>
@ -53,7 +53,7 @@
<!-- Sparkle settings https://sparkle-project.org/documentation/customization/ -->
<key>SUFeedURL</key>
<string>https://www.wireshark.org/update/0/Logwolf/@PROJECT_MAJOR_VERSION@.@PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml</string>
<string>https://www.wireshark.org/update/0/Logwolf/@LOG_PROJECT_MAJOR_VERSION@.@LOG_PROJECT_MINOR_VERSION@.@PROJECT_PATCH_VERSION@/macOS/x86-64/en-US/stable.xml</string>
<key>SUEnableAutomaticChecks</key>
<false/>
<key>SUPublicEDKey</key>

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Wireshark</string>
<key>CFBundleGetInfoString</key>
<string>@VERSION@, Copyright 1998-2022 Wireshark Development Team</string>
<string>@PROJECT_VERSION@, Copyright 1998-2022 Wireshark Development Team</string>
<key>CFBundleIconFile</key>
<string>Wireshark.icns</string>
<key>CFBundleIdentifier</key>
@ -224,11 +224,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>@VERSION@</string>
<string>@PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>Wshk</string>
<key>CFBundleVersion</key>
<string>@VERSION@</string>
<string>@PROJECT_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 1998-2022 Wireshark Developers, GNU General Public License.</string>
<key>NSPrincipalClass</key>

View File

@ -18,7 +18,7 @@ import os.path
# .. Useful stuff ..............................................................
lw_version = '@VERSION@'
lw_version = '@LOG_PROJECT_VERSION@'
lw_volname = 'Logwolf ' + lw_version
lw_srcdir = '@CMAKE_SOURCE_DIR@'
lw_bindir = '@CMAKE_BINARY_DIR@'

View File

@ -18,7 +18,7 @@ import os.path
# .. Useful stuff ..............................................................
lw_version = '@VERSION@'
lw_version = '@LOG_PROJECT_VERSION@'
lw_volname = 'Logwolf Debugging Symbols' + lw_version
lw_srcdir = '@CMAKE_SOURCE_DIR@'
lw_bindir = '@CMAKE_BINARY_DIR@'

View File

@ -6,7 +6,7 @@ set -e
# Defaults
dmgbuild="@DMGBUILD_EXECUTABLE@"
version="@VERSION@"
version="@PROJECT_VERSION@"
app_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-app.dmgbuild"
dsym_settings_file="@CMAKE_BINARY_DIR@/packaging/macosx/wireshark-dsym.dmgbuild"
architecture=""

View File

@ -18,7 +18,7 @@ import os.path
# .. Useful stuff ..............................................................
ws_version = '@VERSION@'
ws_version = '@PROJECT_VERSION@'
ws_volname = 'Wireshark ' + ws_version
ws_srcdir = '@CMAKE_SOURCE_DIR@'
ws_bindir = '@CMAKE_BINARY_DIR@'

View File

@ -18,7 +18,7 @@ import os.path
# .. Useful stuff ..............................................................
ws_version = '@VERSION@'
ws_version = '@PROJECT_VERSION@'
ws_volname = 'Wireshark Debugging Symbols' + ws_version
ws_srcdir = '@CMAKE_SOURCE_DIR@'
ws_bindir = '@CMAKE_BINARY_DIR@'

View File

@ -12,9 +12,9 @@
#define EXTRA_INSTALLER_DIR "@EXTRA_INSTALLER_DIR@"
#define NPCAP_PACKAGE_VERSION @NPCAP_PACKAGE_VERSION@
#define USBPCAP_PACKAGE_VERSION @USBPCAP_PACKAGE_VERSION@
#define VERSION @VERSION@
#define VERSION_MAJOR @VERSION_MAJOR@
#define VERSION_MINOR @VERSION_MINOR@
#define VERSION @PROJECT_VERSION@
#define VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define VERSION_MINOR @PROJECT_VERSION_MINOR@
#define PRODUCT_VERSION @PRODUCT_VERSION@
#define VCREDIST_DIR "@VCREDIST_DIR@"

View File

@ -20,7 +20,7 @@ CommercialUse=true
[Version]
PackageVersion=@PORTABLEAPPS_PACKAGE_VERSION@
DisplayVersion=@VERSION@
DisplayVersion=@PROJECT_VERSION@
[Control]
Icons=1

View File

@ -43,7 +43,7 @@
# are set.
%global use_wireshark_group 1
%global package_version @VERSION@
%global package_version @PROJECT_VERSION@
Summary: The world's foremost protocol analyzer

View File

@ -34,12 +34,12 @@ shift $(( OPTIND - 1 ))
# The remaining parameter, if set, is a package version such as 3.4.5
# or 3.4.5-67-gabcd4321
# By default the version from make-version.pl + CMake is used.
VERSION=@VERSION@
PROJECT_VERSION=@PROJECT_VERSION@
if test -n "${1-}"; then
VERSION="$1"
PROJECT_VERSION="$1"
fi
TARBALL="${DESTDIR}/wireshark-${VERSION}.tar.xz"
TARBALL="${DESTDIR}/wireshark-${PROJECT_VERSION}.tar.xz"
# A tarball produced by 'git archive' will have the $Format string
# substituted due to the use of 'export-subst' in .gitattributes.
@ -65,7 +65,7 @@ if [[ $COMMIT != \$F* ]] ; then
echo ""
echo "The build system cannot produce a source tarball outside of a git repository."
echo "If you are trying to build an RPM package from source extracted from a tarball,"
echo "copy it (i.e., wireshark-${VERSION}.tar.xz) to"
echo "copy it (i.e., wireshark-${PROJECT_VERSION}.tar.xz) to"
echo "$DESTDIR"
echo "and run the build command again."
@ -94,4 +94,4 @@ echo "Creating $TARBALL from $COMMIT"
XZ_OPTS=
echo . | xz --threads=0 > /dev/null 2>&1 && XZ_OPTS=--threads=0
git archive --prefix="wireshark-${VERSION}/" "$COMMIT" | xz $XZ_OPTS > "$TARBALL"
git archive --prefix="wireshark-${PROJECT_VERSION}/" "$COMMIT" | xz $XZ_OPTS > "$TARBALL"

View File

@ -22,12 +22,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community\0"
VALUE "FileDescription", "@PROGRAM_NAME@\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "@PROGRAM_NAME@ @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "@PROGRAM_NAME@ @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © @COPYRIGHT_INFO@\0"
VALUE "OriginalFilename", "@EXE_NAME@.exe\0"
VALUE "ProductName", "@PROGRAM_NAME@\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -22,12 +22,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community\0"
VALUE "FileDescription", "Dumpcap\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "Dumpcap @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "Dumpcap @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "Dumpcap.exe\0"
VALUE "ProductName", "Dumpcap\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -20,12 +20,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0"
VALUE "FileDescription", "Wireshark dissector library\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "libwireshark @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "libwireshark @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "libwireshark.dll\0"
VALUE "ProductName", "Wireshark\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -20,12 +20,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0"
VALUE "FileDescription", "Wireshark capture file library\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "wiretap @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "wiretap @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "libwiretap.dll\0"
VALUE "ProductName", "Wireshark\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -20,12 +20,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0"
VALUE "FileDescription", "Wireshark utility library\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "libwsutil @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "libwsutil @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "libwsutil.dll\0"
VALUE "ProductName", "Wireshark\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@.0"
version="@LOG_PROJECT_VERSION_MAJOR@.@LOG_PROJECT_VERSION_MINOR@.@LOG_PROJECT_VERSION_MICRO@.0"
processorArchitecture="@WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE@"
name="WiresharkDevelopmentTeam.Logwolf"
type="win32"

View File

@ -5,8 +5,8 @@ LOGWOLF_ICON1 ICON "@ICON_PATH@wireshark.ico"
LOGWOLF_ICON2 ICON "@ICON_PATH@wiresharkdoc.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION @RC_VERSION@
PRODUCTVERSION @RC_VERSION@
FILEVERSION @LOG_RC_VERSION@
PRODUCTVERSION @LOG_RC_VERSION@
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS VS_FF_DEBUG
@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0"
VALUE "FileDescription", "Logwolf\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "Logwolf @VERSION@\0"
VALUE "FileVersion", "@LOG_PROJECT_VERSION@\0"
VALUE "InternalName", "Logwolf @LOG_PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2022 Loris Degioanni <loris@sysdig.com>, Gerald Combs <gerald@wireshark.org> and others\0"
VALUE "OriginalFilename", "Logwolf.exe\0"
VALUE "ProductName", "Logwolf\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@LOG_PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -22,12 +22,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community\0"
VALUE "FileDescription", "TShark\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "TShark @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "TShark @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "TShark.exe\0"
VALUE "ProductName", "TShark\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@.0"
version="@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@.@PROJECT_VERSION_MICRO@.0"
processorArchitecture="@WIRESHARK_TARGET_PROCESSOR_ARCHITECTURE@"
name="WiresharkDevelopmentTeam.Wireshark"
type="win32"

View File

@ -23,12 +23,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "The Wireshark developer community, https://www.wireshark.org/\0"
VALUE "FileDescription", "Wireshark\0"
VALUE "FileVersion", "@VERSION@\0"
VALUE "InternalName", "Wireshark @VERSION@\0"
VALUE "FileVersion", "@PROJECT_VERSION@\0"
VALUE "InternalName", "Wireshark @PROJECT_VERSION@\0"
VALUE "LegalCopyright", "Copyright © 2000 Gerald Combs <gerald@wireshark.org>, Gilbert Ramirez <gram@alumni.rice.edu> and others\0"
VALUE "OriginalFilename", "Wireshark.exe\0"
VALUE "ProductName", "Wireshark\0"
VALUE "ProductVersion", "@VERSION@\0"
VALUE "ProductVersion", "@PROJECT_VERSION@\0"
END
END
BLOCK "VarFileInfo"

View File

@ -7,7 +7,7 @@ plugindir=@plugindir@
Name: Wireshark
Description: Network Packet Dissection Library
Version: @VERSION@
Version: @PROJECT_VERSION@
Requires: glib-2.0, gmodule-2.0, gthread-2.0
Libs: -L${libdir} -lwireshark -lwsutil