mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Fixed cmake python location.
Fixed build issue with VS2015.
This commit is contained in:
+1
-2
@@ -12,8 +12,7 @@ LIST(APPEND CMAKE_PREFIX_PATH ${DEPENDENCIES_DIR}/qt5/lib/cmake)
|
||||
FILE(GLOB_RECURSE BOOST_ROOT ${DEPENDENCIES_DIR}/boost*/project-config.jam)
|
||||
GET_FILENAME_COMPONENT(BOOST_ROOT ${BOOST_ROOT} DIRECTORY)
|
||||
|
||||
FILE(GLOB_RECURSE PYTHON_ROOT ${DEPENDENCIES_DIR}/Python*/python.vcxproj)
|
||||
GET_FILENAME_COMPONENT(PYTHON_ROOT ${PYTHON_ROOT} DIRECTORY)
|
||||
FILE(GLOB_RECURSE PYTHON_ROOT ${DEPENDENCIES_DIR}/Python*/pyconfig.h.in)
|
||||
GET_FILENAME_COMPONENT(PYTHON_ROOT ${PYTHON_ROOT} DIRECTORY)
|
||||
|
||||
FILE(GLOB_RECURSE SIP_ROOT ${DEPENDENCIES_DIR}/sip*/siplib/sip.h)
|
||||
|
||||
@@ -4,12 +4,22 @@
|
||||
#include "gilock.h"
|
||||
#include <QWidget>
|
||||
|
||||
namespace bpy = boost::python;
|
||||
namespace boost
|
||||
{
|
||||
// See bug https://connect.microsoft.com/VisualStudio/Feedback/Details/2852624
|
||||
template<> const volatile MOBase::IOrganizer* get_pointer(const volatile MOBase::IOrganizer* p) { return p; }
|
||||
template<> const volatile MOBase::IModInterface* get_pointer(const volatile MOBase::IModInterface* p) { return p; }
|
||||
template<> const volatile MOBase::IPluginGame* get_pointer(const volatile MOBase::IPluginGame* p) { return p; }
|
||||
template<> const volatile MOBase::IProfile* get_pointer(const volatile MOBase::IProfile* p) { return p; }
|
||||
template<> const volatile MOBase::IModList* get_pointer(const volatile MOBase::IModList* p) { return p; }
|
||||
template<> const volatile MOBase::IPluginList* get_pointer(const volatile MOBase::IPluginList* p) { return p; }
|
||||
template<> const volatile MOBase::IDownloadManager* get_pointer(const volatile MOBase::IDownloadManager* p) { return p; }
|
||||
template<> const volatile MOBase::IModRepositoryBridge* get_pointer(const volatile MOBase::IModRepositoryBridge* p) { return p; }
|
||||
}
|
||||
|
||||
using namespace MOBase;
|
||||
|
||||
|
||||
#define PYCATCH catch (const bpy::error_already_set &) { reportPythonError(); throw MyException("unhandled exception"); }\
|
||||
#define PYCATCH catch (const boost::python::error_already_set &) { reportPythonError(); throw MyException("unhandled exception"); }\
|
||||
catch (...) { throw MyException("An unknown exception was thrown in python code"); }
|
||||
|
||||
|
||||
@@ -18,7 +28,7 @@ using namespace MOBase;
|
||||
bool IPluginWrapper::init(MOBase::IOrganizer *moInfo)
|
||||
{
|
||||
try {
|
||||
return this->get_override("init")(bpy::ptr(moInfo));
|
||||
return this->get_override("init")(boost::python::ptr(moInfo));
|
||||
} PYCATCH;
|
||||
}
|
||||
|
||||
@@ -71,7 +81,7 @@ QList<MOBase::PluginSetting> IPluginWrapper::settings() const
|
||||
bool IPluginToolWrapper::init(MOBase::IOrganizer *moInfo)
|
||||
{
|
||||
try {
|
||||
return this->get_override("init")(bpy::ptr(moInfo));
|
||||
return this->get_override("init")(boost::python::ptr(moInfo));
|
||||
} PYCATCH;
|
||||
}
|
||||
|
||||
@@ -162,7 +172,7 @@ void IPluginToolWrapper::display() const
|
||||
bool IPluginInstallerCustomWrapper::init(MOBase::IOrganizer *moInfo)
|
||||
{
|
||||
try {
|
||||
return this->get_override("init")(bpy::ptr(moInfo));
|
||||
return this->get_override("init")(boost::python::ptr(moInfo));
|
||||
} PYCATCH;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user