diff --git a/CMakeLists.txt b/CMakeLists.txt index e53e47d33..e283d3942 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -837,6 +837,13 @@ endif(WIN32) +# version information of libraries +# +if(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx) + set(HAVE_OCC_VERSION 1) +endif(OCC_INCLUDE_DIR AND EXISTS ${OCC_INCLUDE_DIR}/Standard_Version.hxx) + +configure_file(LibraryVersions.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/LibraryVersions.h) # ================================================================================ # == Global Compiler and Linker Settings ========================================= diff --git a/LibraryVersions.h.cmake b/LibraryVersions.h.cmake new file mode 100644 index 000000000..8dfbbe698 --- /dev/null +++ b/LibraryVersions.h.cmake @@ -0,0 +1,13 @@ +#ifndef LIBRARY_VERSIONS_H +#define LIBRARY_VERSIONS_H + +/* LibraryVersions.h. Generated from LibraryVersions.h.cmake by cmake. */ + +#cmakedefine HAVE_OCC_VERSION + +#if defined(HAVE_OCC_VERSION) +# include <${OCC_INCLUDE_DIR}/Standard_Version.hxx> +#endif + +#endif // LIBRARY_VERSIONS_H + diff --git a/src/Gui/Splashscreen.cpp b/src/Gui/Splashscreen.cpp index 0e6610abe..1f41d96eb 100644 --- a/src/Gui/Splashscreen.cpp +++ b/src/Gui/Splashscreen.cpp @@ -34,6 +34,8 @@ # include #endif +#include + #include "Splashscreen.h" #include "ui_AboutApplication.h" #include @@ -547,9 +549,16 @@ void AboutDialog::on_copyButton_clicked() str << "Python version: " << PY_VERSION << endl; str << "Qt version: " << QT_VERSION_STR << endl; str << "Coin version: " << COIN_VERSION << endl; - it = config.find("OCC_VERSION"); - if (it != config.end()) - str << "OCC version: " << it->second.c_str() << endl; +#if defined(HAVE_OCC_VERSION) + str << "OCC version: " + << OCC_VERSION_MAJOR << "." + << OCC_VERSION_MINOR << "." + << OCC_VERSION_MAINTENANCE +#ifdef OCC_VERSION_DEVELOPMENT + << "." OCC_VERSION_DEVELOPMENT +#endif + << endl; +#endif QClipboard* cb = QApplication::clipboard(); cb->setText(data); diff --git a/src/Mod/Part/App/AppPart.cpp b/src/Mod/Part/App/AppPart.cpp index 2e3661677..f6ae27a6e 100644 --- a/src/Mod/Part/App/AppPart.cpp +++ b/src/Mod/Part/App/AppPart.cpp @@ -106,13 +106,6 @@ PyObject* Part::PartExceptionOCCDimensionError; PyMODINIT_FUNC initPart() { - std::stringstream str; - str << OCC_VERSION_MAJOR << "." << OCC_VERSION_MINOR << "." << OCC_VERSION_MAINTENANCE; -#ifdef OCC_VERSION_DEVELOPMENT - str << "." OCC_VERSION_DEVELOPMENT; -#endif - App::Application::Config()["OCC_VERSION"] = str.str(); - Base::Console().Log("Module: Part\n"); // This is highly experimental and we should keep an eye on it