zynaddsubfx

ZynAddSubFX open source synthesizer
Log | Files | Refs | Submodules | LICENSE

commit 3f97745f4392402daa8a98a9f325bbee3fb1db86
parent a9c0a27a9fd0846950356b03a94b1e76164fe79a
Author: fundamental <mark.d.mccurry@gmail.com>
Date:   Wed, 28 Dec 2011 00:25:36 -0500

Version: Versioning information added

- Version information added in the form of a cmake controlled define
- "--version" or "-v" flags now cause the program to print the current version

Diffstat:
MCMakeLists.txt | 1+
Msrc/CMakeLists.txt | 3+++
Msrc/Misc/XMLwrapper.cpp | 2+-
Msrc/main.cpp | 17++++++++++++++---
4 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 2.8) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/") project(zynaddsubfx) +set(VERSION "2.4.2-pre") enable_testing() include(CTestConfig.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt @@ -47,6 +47,9 @@ SET (DssiEnable ${DSSI_FOUND} CACHE BOOL # Now, handle the incoming settings and set define flags/variables based # on this +# Add version information +add_definitions(-DVERSION="${VERSION}") + if (GuiModule STREQUAL qt AND QT_FOUND) set (QtGui TRUE) elseif(GuiModule STREQUAL fltk AND FLTK_FOUND) diff --git a/src/Misc/XMLwrapper.cpp b/src/Misc/XMLwrapper.cpp @@ -98,7 +98,7 @@ XMLwrapper::XMLwrapper() { version.Major = 2; version.Minor = 4; - version.Revision = 1; + version.Revision = 2; minimal = true; diff --git a/src/main.cpp b/src/main.cpp @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) dump.startnow(); int noui = 0; cerr - << "\nZynAddSubFX - Copyright (c) 2002-2009 Nasca Octavian Paul and others" + << "\nZynAddSubFX - Copyright (c) 2002-2011 Nasca Octavian Paul and others" << endl; cerr << "Compiled: " << __DATE__ << " " << __TIME__ << endl; cerr << "This program is free software (GNU GPL v.2 or later) and \n"; @@ -237,6 +237,9 @@ int main(int argc, char *argv[]) "help", 2, NULL, 'h' }, { + "version",2,NULL,'v' + }, + { "named", 1, NULL, 'N' }, { @@ -253,7 +256,7 @@ int main(int argc, char *argv[]) } }; opterr = 0; - int option_index = 0, opt, exitwithhelp = 0; + int option_index = 0, opt, exitwithhelp = 0, exitwithversion = 0; string loadfile, loadinstrument; @@ -263,7 +266,7 @@ int main(int argc, char *argv[]) /**\todo check this process for a small memory leak*/ opt = getopt_long(argc, argv, - "l:L:r:b:o:I:O:N:haSDUY", + "l:L:r:b:o:I:O:N:hvaSDUY", opts, &option_index); char *optarguments = optarg; @@ -281,6 +284,9 @@ int main(int argc, char *argv[]) case 'h': exitwithhelp = 1; break; + case 'v': + exitwithversion = 1; + break; case 'Y':/* this command a dummy command (has NO effect) and is used because I need for NSIS installer (NSIS sometimes forces a command line for a @@ -355,9 +361,14 @@ int main(int argc, char *argv[]) } } + if(exitwithversion) { + cout << "Version: " << VERSION << endl; + return 0; + } if(exitwithhelp != 0) { cout << "Usage: zynaddsubfx [OPTION]\n\n" << " -h , --help \t\t\t\t Display command-line help and exit\n" + << " -v , --version \t\t\t Display version and exit\n" << " -l file, --load=FILE\t\t\t Loads a .xmz file\n" << " -L file, --load-instrument=FILE\t Loads a .xiz file\n" << " -r SR, --sample-rate=SR\t\t Set the sample rate SR\n"