diff options
Diffstat (limited to 'cmake/sword_version_compare.cpp')
-rw-r--r-- | cmake/sword_version_compare.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/sword_version_compare.cpp b/cmake/sword_version_compare.cpp new file mode 100644 index 0000000..f67a5c9 --- /dev/null +++ b/cmake/sword_version_compare.cpp @@ -0,0 +1,23 @@ +/********* +* +* This file is part of BibleTime's source code, http://www.bibletime.info/. +* +* Copyright 1999-2008 by the BibleTime developers. +* The BibleTime source code is licensed under the GNU General Public License version 2.0. +* +**********/ + +/* + * Check if Sword's current version is equal or larger than the version given to the program (first commandline argument) + */ + +#include <iostream> + +#include <swversion.h> + +int main(int argc, char* argv[]) +{ + sword::SWVersion testversion(argv[1]); + std::cout << "Your installed Sword version is: " << sword::SWVersion::currentVersion.getText(); + return (sword::SWVersion::currentVersion >= testversion) ? 0 : 1; +} |