Skip to content

Commit

Permalink
App: save version number of the most important libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Nov 23, 2021
1 parent 1da079b commit 7f50605
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/App/Application.cpp
Expand Up @@ -138,6 +138,7 @@
#include <QFileInfo>
#include <QProcessEnvironment>
#include <QStandardPaths>
#include <LibraryVersions.h>

This comment has been minimized.

Copy link
@donovaly

donovaly Nov 23, 2021

Member

@wwmayer
This file is missing. I get now this compiler failure with MSVC:

D:\FreeCAD-git\src\App\Application.cpp(141,10): fatal error C1083: Cannot open include file: 'LibraryVersions.h': No such file or directory

This comment has been minimized.

Copy link
@wwmayer

wwmayer Nov 23, 2021

Author Contributor

How should that fail now? LibraryVersions.h is used inside SplashScreen.cpp for many years without problems.

In the root directory there is a file LibraryVersions.h.cmake and at CMake configure time it creates the file LibraryVersions.h and puts it to the build directory.

And also the automatic builds succeed. However, there is a thing you could try. To the src/App/CMakeLists.txt file look at the top for include_directories and add there the entry: ${CMAKE_BINARY_DIR}

This comment has been minimized.

Copy link
@donovaly

donovaly Nov 23, 2021

Member

How should that fail now? LibraryVersions.h is used inside SplashScreen.cpp for many years without problems.

Yes and for Application.cpp in Gui it works without problems, but not for Application.cpp in App. So it appears as if LibraryVersions.h is unknown in App.

This comment has been minimized.

Copy link
@donovaly

donovaly Nov 23, 2021

Member

src/App/CMakeLists.txt file look at the top for include_directories and add there the entry: ${CMAKE_BINARY_DIR}

many thanks. This changes fixes the issue for me:

 src/App/CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/App/CMakeLists.txt b/src/App/CMakeLists.txt
index be1699a541..cf28254422 100644
--- a/src/App/CMakeLists.txt
+++ b/src/App/CMakeLists.txt
@@ -48,6 +48,7 @@ fc_copy_file_if_different(
 # -----------------------------------------------------------------------------
 
 include_directories(
+    ${CMAKE_BINARY_DIR}
     ${CMAKE_BINARY_DIR}/src
     ${CMAKE_SOURCE_DIR}/src
     ${CMAKE_CURRENT_BINARY_DIR}


using namespace App;
using namespace std;
Expand Down Expand Up @@ -2525,6 +2526,19 @@ void Application::initConfig(int argc, char ** argv)

// capture path
SaveEnv("PATH");

// Save version numbers of the libraries
#ifdef OCC_VERSION_STRING_EXT
mConfig["OCC_VERSION"] = OCC_VERSION_STRING_EXT;
#endif
mConfig["BOOST_VERSION"] = BOOST_LIB_VERSION;
mConfig["PYTHON_VERSION"] = PY_VERSION;
mConfig["QT_VERSION"] = QT_VERSION_STR;
mConfig["EIGEN_VERSION"] = FC_EIGEN3_VERSION;
mConfig["PYSIDE_VERSION"] = FC_PYSIDE_VERSION;
mConfig["XERCESC_VERSION"] = FC_XERCESC_VERSION;


logStatus();
}

Expand Down
3 changes: 3 additions & 0 deletions src/Gui/Application.cpp
Expand Up @@ -139,6 +139,7 @@
#include <Gui/Quarter/Quarter.h>
#include "View3DViewerPy.h"
#include <Gui/GuiInitScript.h>
#include <LibraryVersions.h>


using namespace Gui;
Expand Down Expand Up @@ -452,6 +453,8 @@ Application::Application(bool GUIenabled)
Py_DECREF(descr);
}

App::Application::Config()["COIN_VERSION"] = COIN_VERSION;

// Python console binding
PythonDebugModule ::init_module();
PythonStdout ::init_type();
Expand Down

0 comments on commit 7f50605

Please sign in to comment.