Command line tool prints WSJT-X version to console, tnx Dave, W3DJS

This commit is contained in:
Bill Somerville 2020-12-02 01:53:36 +00:00
parent 917e87cee5
commit 94f0af72e3
No known key found for this signature in database
GPG Key ID: D864B06D1E81618F
3 changed files with 54 additions and 2 deletions

43
AppVersion/AppVersion.cpp Normal file
View File

@ -0,0 +1,43 @@
//
// wsjtx_app_version - a console application that outputs WSJT-X
// application version
//
// This application is only provided as a simple console application
//
//
#include <cstdlib>
#include <iostream>
#include <exception>
#include <QCoreApplication>
#include <QCommandLineParser>
#include <QCommandLineOption>
#include "revision_utils.hpp"
int main (int argc, char * argv[])
{
QCoreApplication app {argc, argv};
try
{
app.setApplicationName ("WSJT-X");
app.setApplicationVersion (version());
QCommandLineParser parser;
// parser.setApplicationDescription ("\n" PROJECT_DESCRIPTION);
parser.addHelpOption ();
parser.addVersionOption ();
parser.process (app);
return EXIT_SUCCESS;
}
catch (std::exception const& e)
{
std::cerr << "Error: " << e.what () << '\n';
}
catch (...)
{
std::cerr << "Unexpected error\n";
}
return -1;
}

View File

@ -1457,6 +1457,15 @@ generate_version_info (udp_daemon_VERSION_RESOURCES
add_executable (udp_daemon UDPExamples/UDPDaemon.cpp ${udp_daemon_VERSION_RESOURCES}) add_executable (udp_daemon UDPExamples/UDPDaemon.cpp ${udp_daemon_VERSION_RESOURCES})
target_link_libraries (udp_daemon wsjtx_udp-static) target_link_libraries (udp_daemon wsjtx_udp-static)
generate_version_info (wsjtx_app_version_VERSION_RESOURCES
NAME wsjtx_app_version
BUNDLE ${PROJECT_BUNDLE_NAME}
ICON ${WSJTX_ICON_FILE}
FILE_DESCRIPTION "Display WSJT-X Application Version on console"
)
add_executable (wsjtx_app_version AppVersion/AppVersion.cpp ${wsjtx_app_version_VERSION_RESOURCES})
target_link_libraries (wsjtx_app_version wsjt_qt)
generate_version_info (message_aggregator_VERSION_RESOURCES generate_version_info (message_aggregator_VERSION_RESOURCES
NAME message_aggregator NAME message_aggregator
BUNDLE ${PROJECT_BUNDLE_NAME} BUNDLE ${PROJECT_BUNDLE_NAME}
@ -1516,7 +1525,7 @@ install (TARGETS wsjtx
# DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx # DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/wsjtx
# ) # )
install (TARGETS udp_daemon message_aggregator install (TARGETS udp_daemon message_aggregator wsjtx_app_version
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT runtime
) )

View File

@ -23,7 +23,7 @@ CAboutDlg::CAboutDlg(QWidget *parent) :
"We gratefully acknowledge contributions from AC6SL, AE4JY,<br />" "We gratefully acknowledge contributions from AC6SL, AE4JY,<br />"
"DF2ET, DJ0OT, G3WDG, G4KLA, IV3NWV, IW3RAB, KA1GT, K3WYC,<br />" "DF2ET, DJ0OT, G3WDG, G4KLA, IV3NWV, IW3RAB, KA1GT, K3WYC,<br />"
"KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR,<br />" "KA6MAL, KA9Q, KB1ZMX, KD6EKQ, KI7MT, KK1D, ND0B, PY2SDR,<br />"
"VE1SKY, VK3ACF, VK4BDJ, VK7MO, W4TI, W4TV, and W9MDB.<br /><br />" "VE1SKY, VK3ACF, VK4BDJ, VK7MO, W3DJS, W4TI, W4TV, and W9MDB.<br /><br />"
"WSJT-X is licensed under the terms of Version 3 <br />" "WSJT-X is licensed under the terms of Version 3 <br />"
"of the GNU General Public License (GPL) <br /><br />" "of the GNU General Public License (GPL) <br /><br />"
"<a href=" TO_STRING__ (PROJECT_HOMEPAGE) ">" "<a href=" TO_STRING__ (PROJECT_HOMEPAGE) ">"