1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 15:53:03 +04:00

apps: add opencv_version command line tool

This commit is contained in:
Alexander Alekhin
2016-09-14 09:22:54 +03:00
parent 473dba1189
commit 2935fcea62
3 changed files with 61 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// 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.
#include <iostream>
#include <opencv2/core.hpp>
int main(int argc, const char** argv)
{
cv::CommandLineParser parser(argc, argv,
"{ help h usage ? | | show this help message }"
"{ verbose v | | show build configuration log }"
);
if (parser.has("help"))
{
parser.printMessage();
}
else if (parser.has("verbose"))
{
std::cout << cv::getBuildInformation().c_str() << std::endl;
}
else
{
std::cout << CV_VERSION << std::endl;
}
return 0;
}