mirror of
https://github.com/OpenFOAM/ThirdParty-6.git
synced 2025-12-08 06:57:43 +00:00
56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
#cmakedefine PARAVIEW_USE_UNIFIED_BINDINGS
|
|
#cmakedefine NO_PYTHON_BINDINGS_AVAILABLE
|
|
#ifdef NO_PYTHON_BINDINGS_AVAILABLE
|
|
#undef PARAVIEW_USE_UNIFIED_BINDINGS
|
|
#endif
|
|
#ifdef PARAVIEW_USE_UNIFIED_BINDINGS
|
|
#include "vtkPython.h"
|
|
#include "vtkPythonInterpreter.h"
|
|
#endif
|
|
|
|
#include "vtkClientServerInterpreter.h"
|
|
|
|
#ifndef PARAVIEW_BUILD_SHARED_LIBS
|
|
#cmakedefine PARAVIEW_BUILD_SHARED_LIBS
|
|
#endif
|
|
#if defined(PARAVIEW_BUILD_SHARED_LIBS) && defined(_WIN32)
|
|
# define VTK_WRAP_CS_EXPORT __declspec(dllexport)
|
|
#else
|
|
# define VTK_WRAP_CS_EXPORT
|
|
#endif
|
|
|
|
#ifdef PARAVIEW_USE_UNIFIED_BINDINGS
|
|
extern "C" void real_init@BARE_TARGET@Python(const char *modulename);
|
|
|
|
void init@BARE_TARGET@Python()
|
|
{
|
|
static const char modulename[] = "@BARE_TARGET@Python";
|
|
real_init@BARE_TARGET@Python(modulename);
|
|
}
|
|
#endif
|
|
|
|
@CXX_CONTENTS@
|
|
|
|
extern "C" void VTK_WRAP_CS_EXPORT @CS_TARGET@_Initialize(
|
|
vtkClientServerInterpreter *csi)
|
|
{
|
|
#ifdef PARAVIEW_USE_UNIFIED_BINDINGS
|
|
if (!vtkPythonInterpreter::IsInitialized())
|
|
{
|
|
vtkPythonInterpreter::Initialize();
|
|
}
|
|
|
|
static bool initialized = false;
|
|
|
|
if (!initialized)
|
|
{
|
|
initialized = true;
|
|
PyImport_AppendInittab("@BARE_TARGET@Python", init@BARE_TARGET@Python);
|
|
}
|
|
|
|
csi->Load("@BARE_TARGET@");
|
|
#endif
|
|
|
|
@CXX_CONTENTS2@
|
|
}
|