2018-02-19 23:53:17 +08:00
|
|
|
// This file is part of OpenCV project.
|
|
|
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
|
|
// of this distribution and at http://opencv.org/license.html
|
|
|
|
|
2013-03-15 00:10:54 +08:00
|
|
|
#include <opencv2/core/utility.hpp>
|
2012-04-14 05:50:59 +08:00
|
|
|
#include <iostream>
|
|
|
|
|
2018-02-19 23:53:17 +08:00
|
|
|
static const std::string keys = "{ b build | | print complete build info }"
|
|
|
|
"{ h help | | print this help }";
|
2012-04-14 05:50:59 +08:00
|
|
|
|
|
|
|
int main(int argc, const char* argv[])
|
|
|
|
{
|
|
|
|
cv::CommandLineParser parser(argc, argv, keys);
|
2018-02-19 23:53:17 +08:00
|
|
|
parser.about("This sample outputs OpenCV version and build configuration.");
|
2012-09-07 17:24:48 +08:00
|
|
|
if (parser.has("help"))
|
2012-04-14 05:50:59 +08:00
|
|
|
{
|
2012-09-07 17:24:48 +08:00
|
|
|
parser.printMessage();
|
2012-04-14 05:50:59 +08:00
|
|
|
}
|
2012-09-07 17:24:48 +08:00
|
|
|
else if (!parser.check())
|
|
|
|
{
|
|
|
|
parser.printErrors();
|
|
|
|
}
|
|
|
|
else if (parser.has("build"))
|
2012-04-14 05:50:59 +08:00
|
|
|
{
|
|
|
|
std::cout << cv::getBuildInformation() << std::endl;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-10-05 01:39:26 +08:00
|
|
|
std::cout << "Welcome to OpenCV " << CV_VERSION << std::endl;
|
2012-04-14 05:50:59 +08:00
|
|
|
}
|
|
|
|
return 0;
|
2012-09-07 17:24:48 +08:00
|
|
|
}
|