App: in verbose mode print used library versions

This commit is contained in:
wmayer
2022-03-31 16:33:00 +02:00
parent e0e523e626
commit 9fcf5faf69
2 changed files with 19 additions and 1 deletions

View File

@@ -11,13 +11,15 @@
/* No need for Boost (version info is always included in the source) */
/* No need for Coin (version info is always included in the source) */
/* No need for Python (version info is always included in the source) */
/* No need for Qt (version info is always included in the source) */
/* No need for zlib (version info is always included in the source) */
// No CMake version info for SMESH, libarea, Zipios, or KDL
// Coin3D
constexpr char * FC_COIN3D_VERSION = "${COIN3D_VERSION}";
// Eigen3
constexpr char * FC_EIGEN3_VERSION = "${EIGEN3_VERSION}";

View File

@@ -2128,6 +2128,7 @@ void parseProgramOptions(int ac, char ** av, const string& exe, variables_map& v
options_description generic("Generic options");
generic.add_options()
("version,v", "Prints version string")
("verbose", "Prints verbose version string")
("help,h", "Prints help message")
("console,c", "Starts in console mode")
("response-file", value<string>(),"Can be specified with '@name', too")
@@ -2293,6 +2294,21 @@ void processProgramOptions(const variables_map& vm, std::map<std::string,std::st
std::stringstream str;
str << mConfig["ExeName"] << " " << mConfig["ExeVersion"]
<< " Revision: " << mConfig["BuildRevision"] << std::endl;
if (vm.count("verbose")) {
str << "\nLibrary versions:\n";
str << "boost " << BOOST_LIB_VERSION << '\n';
str << "Coin3D " << FC_COIN3D_VERSION << '\n';
str << "Eigen3 " << FC_EIGEN3_VERSION << '\n';
#ifdef OCC_VERSION_STRING_EXT
str << "OCC " << OCC_VERSION_STRING_EXT << '\n';
#endif
str << "Qt " << QT_VERSION_STR << '\n';
str << "Python " << PY_VERSION << '\n';
str << "PySide " << FC_PYSIDE_VERSION << '\n';
str << "shiboken " << FC_SHIBOKEN_VERSION << '\n';
str << "VTK " << FC_VTK_VERSION << '\n';
str << "xerces-c " << FC_XERCESC_VERSION << '\n';
}
throw Base::ProgramInformation(str.str());
}