Skip to content
Snippets Groups Projects
Verified Commit a90d67ee authored by Lars Bilke's avatar Lars Bilke
Browse files

[CMake] Add ogs_prj_directory as a global variable to Python runtime.

parent 3ee1008a
No related branches found
No related tags found
No related merge requests found
......@@ -288,6 +288,9 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
// Evaluate in scope of main module
py::object scope = py::module::import("__main__").attr("__dict__");
// add (global) variables
auto globals = py::dict(scope);
globals["ogs_prj_directory"] = project_directory;
py::eval_file(script_path, scope);
#else
OGS_FATAL("OpenGeoSys has not been built with Python support.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment