Fixed cmake python location.

Fixed build issue with VS2015.
This commit is contained in:
lepresidente
2016-11-27 16:54:19 +02:00
parent aa37f30c68
commit cc58ccc992
2 changed files with 17 additions and 8 deletions
+1 -2
View File
@@ -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)
+16 -6
View File
@@ -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;
}