#= Config Header
#-------------------------------------------------------------------------------
+set(PV_TITLE PulseView)
+
set(PV_VERSION_MAJOR 0)
set(PV_VERSION_MINOR 1)
set(PV_VERSION_MICRO 0)
if(ENABLE_TESTS)
- add_definitions(-DBOOST_TEST_DYN_LINK)
+ add_definitions(pulseview-tests
+ -DBOOST_TEST_DYN_LINK
+ )
add_executable(pulseview-test
${pulseview_TEST_SOURCES}
#ifndef _PULSEVIEW_CONFIG_H
#define _PULSEVIEW_CONFIG_H
+/* Application Details */
+#define PV_TITLE "@PV_TITLE@"
+
/* Pulseview version information */
#define PV_VERSION_MAJOR @PV_VERSION_MAJOR@
#define PV_VERSION_MINOR @PV_VERSION_MINOR@
#include <libsigrok/libsigrok.h>
}
+#include <getopt.h>
+
#include <QtGui/QApplication>
#include <QDebug>
QApplication::setApplicationName("PulseView");
QApplication::setOrganizationDomain("http://www.sigrok.org");
+ // Parse arguments
+ while (1) {
+ static const struct option long_options[] = {
+ {"version", no_argument, 0, 'V'},
+ {0, 0, 0, 0}
+ };
+
+ const char c = getopt_long(argc, argv, "V", long_options, NULL);
+ if (c == -1)
+ break;
+
+ switch (c) {
+ case 'V':
+ // Print version info
+ fprintf(stderr, "%s %s\n", PV_TITLE, PV_VERSION_STRING);
+ return 0;
+ }
+ }
+
// Initialise libsigrok
if (sr_init() != SR_OK) {
qDebug() << "ERROR: libsigrok init failed.";