Skip to content
Snippets Groups Projects
Commit 55288146 authored by Adam Radziszewski's avatar Adam Radziszewski
Browse files

pass version info to settings.h and tagset-tool

parent d78ac254
No related branches found
No related tags found
No related merge requests found
PROJECT(Corpus2Library)
set(corpus2_ver_major "1")
set(corpus2_ver_minor "0")
set(corpus2_ver_patch "12")
add_definitions(-DLIBCORPUS2_VERSION_MAJOR=${corpus2_ver_major})
add_definitions(-DLIBCORPUS2_VERSION_MINOR=${corpus2_ver_minor})
add_definitions(-DLIBCORPUS2_VERSION_PATCH=${corpus2_ver_patch})
cmake_minimum_required(VERSION 2.8.0)
# use some of our own Find* scripts
......
......@@ -223,6 +223,7 @@ int main(int argc, char** argv)
("sort,s", value(&sort)->zero_tokens(),
"Sort parsed tags")
("help,h", "Show help")
("version", "print version string")
;
boost::program_options::variables_map vm;
boost::program_options::positional_options_description p;
......@@ -244,6 +245,10 @@ int main(int argc, char** argv)
std::cout << Corpus2::available_tagsets() << "\n";
return 1;
}
if (vm.count("version")) {
std::cout << "tagset-tool (libcorpus2) " << Corpus2::version_string() << "\n";
return 0;
}
Corpus2::Path::Instance().set_verbose(!quiet);
......
########## libcorpus2 ###############
PROJECT(corpus2)
set(corpus2_ver_major "1")
set(corpus2_ver_minor "0")
set(corpus2_ver_patch "12")
if(NOT LIBCORPUS2_SRC_DATA_DIR)
message(FATAL_ERROR "There is no data for libcorpus2")
endif(NOT LIBCORPUS2_SRC_DATA_DIR)
......
......@@ -24,8 +24,17 @@ or FITNESS FOR A PARTICULAR PURPOSE.
#define LIBCORPUS2_PATH_SEPARATOR ":"
#endif
#include <sstream>
namespace Corpus2 {
const std::string version_string()
{
std::stringstream version;
version << version_major << "." << version_minor << "." << version_patch;
return version.str();
}
Corpus2PathSearcher::Corpus2PathSearcher()
: PwrNlp::PathSearcher<FileNotFound>(LIBCORPUS2_PATH_SEPARATOR)
{
......
......@@ -23,6 +23,12 @@ or FITNESS FOR A PARTICULAR PURPOSE.
namespace Corpus2 {
const int version_major = (LIBCORPUS2_VERSION_MAJOR);
const int version_minor = (LIBCORPUS2_VERSION_MINOR);
const int version_patch = (LIBCORPUS2_VERSION_PATCH);
const std::string version_string();
class Corpus2PathSearcher : public PwrNlp::PathSearcher<FileNotFound>
{
public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment