#include <libxml/parser.h>
#include <libxml/tree.h>
+// Have to be included before std headers
#include <Python.h>
//Necessary for cerr
void Config_ModuleReader::loadScript(const std::string theFileName)
{
std::string aPythonFile = theFileName + ".py";
- PyGILState_STATE gstate;
-
/* aquire python thread */
- gstate = PyGILState_Ensure();
-
+ PyGILState_STATE gstate = PyGILState_Ensure();
PyObject* module = PyImport_ImportModule(aPythonFile.c_str());
-
/* release python thread */
PyGILState_Release(gstate);
}
ADD_DEFINITIONS(-DGEOMAPI_EXPORTS ${CAS_DEFINITIONS})
ADD_LIBRARY(GeomAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-SET(CMAKE_SWIG_FLAGS "-Wall")
+SET(CMAKE_SWIG_FLAGS -threads -Wall)
SET_SOURCE_FILES_PROPERTIES(GeomAPI.i PROPERTIES CPLUSPLUS ON)
SET_SOURCE_FILES_PROPERTIES(GeomAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
SET(PROJECT_LIBRARIES
Config
)
-
-SET(CMAKE_SWIG_FLAGS "-Wall")
+SET(CMAKE_SWIG_FLAGS -threads -Wall)
ADD_DEFINITIONS(-DMODELAPI_EXPORTS -DSWIG_TYPE_TABLE=ModelAPI)
ADD_LIBRARY(ModelAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})