From 4d86fd0dbb6a29a233577803c5541e962d4d58ef Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Feb 2023 21:07:11 +0100 Subject: [PATCH] Remove LIBDCP_VERSION in favour of dcp::version. The former is only set at configure which is a bit confusing, and I can't think of a reason to have both. --- src/cpl.cc | 5 +++-- src/metadata.cc | 5 +++-- tools/dcpdecryptmxf.cc | 3 ++- tools/dcpdiff.cc | 2 +- tools/dcpinfo.cc | 2 +- tools/dcpverify.cc | 14 +++++++++----- 6 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/cpl.cc b/src/cpl.cc index e050c885..0e431cfc 100644 --- a/src/cpl.cc +++ b/src/cpl.cc @@ -51,6 +51,7 @@ #include "reel_sound_asset.h" #include "reel_subtitle_asset.h" #include "util.h" +#include "version.h" #include "warnings.h" #include "xml.h" LIBDCP_DISABLE_WARNINGS @@ -87,8 +88,8 @@ static string const smpte_335_ns = "http://www.smpte-ra.org/reg/335/2012"; CPL::CPL (string annotation_text, ContentKind content_kind, Standard standard) /* default _content_title_text to annotation_text */ - : _issuer ("libdcp" LIBDCP_VERSION) - , _creator ("libdcp" LIBDCP_VERSION) + : _issuer("libdcp", dcp::version) + , _creator("libdcp", dcp::version) , _issue_date (LocalTime().as_string()) , _annotation_text (annotation_text) , _content_title_text (annotation_text) diff --git a/src/metadata.cc b/src/metadata.cc index 750143d1..22c46b40 100644 --- a/src/metadata.cc +++ b/src/metadata.cc @@ -37,9 +37,10 @@ */ +#include "local_time.h" #include "metadata.h" #include "util.h" -#include "local_time.h" +#include "version.h" #include #include #include @@ -51,7 +52,7 @@ using namespace dcp; MXFMetadata::MXFMetadata () : company_name ("libdcp") , product_name ("libdcp") - , product_version (LIBDCP_VERSION) + , product_version(dcp::version) { } diff --git a/tools/dcpdecryptmxf.cc b/tools/dcpdecryptmxf.cc index 4c615f99..33ba79bb 100644 --- a/tools/dcpdecryptmxf.cc +++ b/tools/dcpdecryptmxf.cc @@ -44,6 +44,7 @@ #include "mono_picture_asset.h" #include "mono_picture_asset_writer.h" #include "util.h" +#include "version.h" #include #include #include @@ -125,7 +126,7 @@ main (int argc, char* argv[]) switch (c) { case 'A': - cout << "libdcp version " << LIBDCP_VERSION << "\n"; + cout << "libdcp version " << dcp::version << "\n"; exit (EXIT_SUCCESS); case 'v': verbose = true; diff --git a/tools/dcpdiff.cc b/tools/dcpdiff.cc index 1f760829..a7138b67 100644 --- a/tools/dcpdiff.cc +++ b/tools/dcpdiff.cc @@ -160,7 +160,7 @@ main (int argc, char* argv[]) switch (c) { case 'V': - cout << "dcpdiff version " << LIBDCP_VERSION << "\n"; + cout << "dcpdiff version " << dcp::version << "\n"; exit (EXIT_SUCCESS); case 'h': help (argv[0]); diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc index 46b506fa..03a75518 100644 --- a/tools/dcpinfo.cc +++ b/tools/dcpinfo.cc @@ -315,7 +315,7 @@ main (int argc, char* argv[]) switch (c) { case 'v': - cout << "libdcp version " << LIBDCP_VERSION << "\n"; + cout << "libdcp version " << dcp::version << "\n"; exit (EXIT_SUCCESS); case 'h': help (argv[0]); diff --git a/tools/dcpverify.cc b/tools/dcpverify.cc index 23023fa3..db4b2bce 100644 --- a/tools/dcpverify.cc +++ b/tools/dcpverify.cc @@ -31,10 +31,12 @@ files in the program, then also delete it here. */ -#include "verify.h" -#include "compose.hpp" + #include "common.h" +#include "compose.hpp" #include "raw_convert.h" +#include "verify.h" +#include "version.h" #include #include #include @@ -42,14 +44,16 @@ #include #include -using std::cout; + using std::cerr; +using std::cout; +using std::list; using std::string; using std::vector; -using std::list; using boost::bind; using boost::optional; + static void help (string n) { @@ -98,7 +102,7 @@ main (int argc, char* argv[]) switch (c) { case 'V': - cout << "dcpverify version " << LIBDCP_VERSION << "\n"; + cout << "dcpverify version " << dcp::version << "\n"; exit (EXIT_SUCCESS); case 'h': help (argv[0]); -- 2.30.2