I'm getting a crash when running under rosetta which i think might
be related to having linked in python. So since I'm not currently
using the embedded interpreter, lets not bother linking it in.
${OPENGL_gl_LIBRARY}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_FILESYSTEM_LIBRARY}
${OPENGL_gl_LIBRARY}
${BOOST_PROGRAM_OPTIONS_LIBRARY}
${BOOST_FILESYSTEM_LIBRARY}
- ${BOOST_PYTHON_LIBRARY}
- optimized ${PYTHON_LIBRARIES}
- debug ${PYTHON_DEBUG_LIBRARIES}
+ )
+IF(USE_PYTHON)
+ TARGET_LINK_LIBRARIES(mussagl
+ ${BOOST_PYTHON_LIBRARY}
+ optimized ${PYTHON_LIBRARIES}
+ debug ${PYTHON_DEBUG_LIBRARIES}
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/python.hpp>
#include <boost/python.hpp>
using namespace boost::filesystem;
using namespace boost::filesystem;
QApplication app(argc, argv, opts.useGUI);
Q_INIT_RESOURCE(icons);
QApplication app(argc, argv, opts.useGUI);
Q_INIT_RESOURCE(icons);
- //PyImport_AppendInittab("mussa", initmussa);
- Py_Initialize();
initialize_mussa(opts, argc, argv);
initialize_mussa(opts, argc, argv);
if (opts.runAsPythonInterpeter) {
if (opts.runAsPythonInterpeter) {
boost::python::object main_module((boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("__main__")))));
boost::python::object main_namespace = main_module.attr("__dict__");
boost::python::object main_module((boost::python::handle<>(boost::python::borrowed(PyImport_AddModule("__main__")))));
boost::python::object main_namespace = main_module.attr("__dict__");
int result = boost::python::extract<int>(square(3));
std::cout << "C++ has " << result << std::endl;
PyRun_InteractiveLoop(stdin, "mussa");
int result = boost::python::extract<int>(square(3));
std::cout << "C++ has " << result << std::endl;
PyRun_InteractiveLoop(stdin, "mussa");
- } else if (opts.useGUI) {
+ } else
+#endif /* USE_PYTHON */
+ if (opts.useGUI) {
MussaWindow win(opts.analysis);
win.show();
app.exec();
MussaWindow win(opts.analysis);
win.show();
app.exec();
qFatal(e.what());
} catch (boost::filesystem::filesystem_error e) {
qFatal(e.what());
qFatal(e.what());
} catch (boost::filesystem::filesystem_error e) {
qFatal(e.what());
- } catch (boost::python::error_already_set e) {
+ }
+#ifdef USE_PYTHON
+ catch (boost::python::error_already_set e) {
- } catch (std::runtime_error e) {
+ }
+#endif /* USE_PYTHON */
+ catch (std::runtime_error e) {
qFatal(e.what());
} catch (...) {
qFatal("unrecognized exception");
}
qFatal(e.what());
} catch (...) {
qFatal("unrecognized exception");
}