opencv_version.cpp 567 Bytes
Newer Older
wester committed
1
#include "opencv2/core/core.hpp"
wester committed
2 3 4 5
#include <iostream>

const char* keys =
{
wester committed
6 7
    "{ b |build |false | print complete build info }"
    "{ h |help  |false | print this help           }"
wester committed
8 9 10 11 12 13
};

int main(int argc, const char* argv[])
{
    cv::CommandLineParser parser(argc, argv, keys);

wester committed
14
    if (parser.get<bool>("help"))
wester committed
15
    {
wester committed
16
        parser.printParams();
wester committed
17
    }
wester committed
18
    else if (parser.get<bool>("build"))
wester committed
19 20 21 22 23
    {
        std::cout << cv::getBuildInformation() << std::endl;
    }
    else
    {
wester committed
24
        std::cout << "OpenCV " << CV_VERSION << std::endl;
wester committed
25 26 27 28
    }

    return 0;
}