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