diff --git a/.gitignore b/.gitignore index 419b5ba..bcc50d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ CMakeLists.txt.user edit +build std*.log diff --git a/CMakeLists.txt b/CMakeLists.txt index c6b6332..58f0885 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,13 @@ GET_FILENAME_COMPONENT(SIP_ROOT ${SIP_ROOT} DIRECTORY) # need to install python -INSTALL(FILES ${PYTHON_ROOT}/PCbuild/python27.dll DESTINATION bin) -INSTALL(FILES ${PYTHON_ROOT}/PCbuild/python27.pdb DESTINATION pdb) +IF(EXISTS "${PYTHON_ROOT}/PCbuild/python27.dll") + INSTALL(FILES ${PYTHON_ROOT}/PCbuild/python27.dll DESTINATION bin) + INSTALL(FILES ${PYTHON_ROOT}/PCbuild/python27.pdb DESTINATION pdb) +ELSEIF(EXISTS "${PYTHON_ROOT}/PCbuild/python27.dll") + INSTALL(FILES ${PYTHON_ROOT}/PCbuild/amd64/python27.dll DESTINATION bin) + INSTALL(FILES ${PYTHON_ROOT}/PCbuild/amd64/python27.pdb DESTINATION pdb) +ENDIF() ADD_SUBDIRECTORY(src/runner) diff --git a/src/proxy/CMakeLists.txt b/src/proxy/CMakeLists.txt index bd085d4..d79c36b 100644 --- a/src/proxy/CMakeLists.txt +++ b/src/proxy/CMakeLists.txt @@ -3,9 +3,11 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.8) CMAKE_POLICY(SET CMP0020 NEW) CMAKE_POLICY(SET CMP0043 NEW) -FILE(GLOB ${PROJ_NAME}_SRCS proxypython.cpp) -FILE(GLOB ${PROJ_NAME}_HDRS proxypython.h) +SET(${PROJ_NAME}_SRCS proxypython.cpp) +SET(${PROJ_NAME}_HDRS + proxypython.h + resource.h) SET(CMAKE_INCLUDE_CURRENT_DIR ON) SET(CMAKE_AUTOMOC ON) @@ -26,14 +28,14 @@ SET(default_project_path "${CMAKE_SOURCE_DIR}/../..") GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH) SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects") -SET(lib_path "${project_path}/../install/libs") +SET(lib_path "${project_path}/../../install/libs") ADD_DEFINITIONS(-DUNICODE -D_UNICODE) INCLUDE_DIRECTORIES(${project_path}/uibase/src - ${project_path}/plugin/plugin_python/src/runner/ - ${PYTHON_ROOT}/Include - ${PYTHON_ROOT}/PC) + ${project_path}/plugin_python/src/runner/ + ${PYTHON_ROOT}/Include + ${PYTHON_ROOT}/PC) LINK_DIRECTORIES(${lib_path}) diff --git a/src/proxy/embedrunner.rc b/src/proxy/embedrunner.rc index e3e5f2a..dfdf8ef 100644 --- a/src/proxy/embedrunner.rc +++ b/src/proxy/embedrunner.rc @@ -3,9 +3,5 @@ #ifdef SCONS_BUILD IDR_LOADER_DLL BINARY MOVEABLE PURE pythonRunner.dll #else -#ifdef _DEBUG -IDR_LOADER_DLL BINARY MOVEABLE PURE "..\\..\\pythonRunner\\debug\\pythonRunner.dll" -#else // _DEBUG -IDR_LOADER_DLL BINARY MOVEABLE PURE "..\\..\\pythonRunner\\release\\pythonRunner.dll" -#endif // _DEBUG +IDR_LOADER_DLL BINARY MOVEABLE PURE "..\\runner\\pythonRunner.dll" #endif diff --git a/src/proxy/proxypython.cpp b/src/proxy/proxypython.cpp index c3bbabc..b28b2a8 100644 --- a/src/proxy/proxypython.cpp +++ b/src/proxy/proxypython.cpp @@ -135,8 +135,6 @@ bool ProxyPython::init(IOrganizer *moInfo) return true; } - //m_TempRunnerFile = ExtractResource(IDR_LOADER_DLL, "__pythonRunner.dll"); - //m_RunnerLib = ::LoadLibraryW(ToWString(m_TempRunnerFile).c_str()); m_RunnerLib = ::LoadLibraryW(QDir::toNativeSeparators(m_MOInfo->pluginDataPath() + "/pythonRunner.dll").toStdWString().c_str()); if (m_RunnerLib != nullptr) { CreatePythonRunner_func CreatePythonRunner = (CreatePythonRunner_func)::GetProcAddress(m_RunnerLib, "CreatePythonRunner"); @@ -340,8 +338,3 @@ void ProxyPython::startGuidedFix(unsigned int key) const ::ShellExecuteA(nullptr, "open", s_DownloadPythonURL, nullptr, nullptr, SW_SHOWNORMAL); } } - - -#if QT_VERSION < QT_VERSION_CHECK(5,0,0) -Q_EXPORT_PLUGIN2(proxyPython, ProxyPython) -#endif diff --git a/src/runner/CMakeLists.txt b/src/runner/CMakeLists.txt index 3f06cc4..d3ed603 100644 --- a/src/runner/CMakeLists.txt +++ b/src/runner/CMakeLists.txt @@ -1,6 +1,6 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.8) -SET(PROJ_NAME python_runner) +SET(PROJ_NAME pythonrunner) PROJECT(${PROJ_NAME}) @@ -25,11 +25,13 @@ IF (Boost_FOUND) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) ENDIF (Boost_FOUND) -SET(default_project_path "${CMAKE_SOURCE_DIR}/../..") +SET(default_project_path "${CMAKE_SOURCE_DIR}/..") GET_FILENAME_COMPONENT(${default_project_path} ${default_project_path} REALPATH) SET(project_path "${default_project_path}" CACHE PATH "path to the other mo projects") -SET(lib_path "${project_path}/../install/libs") +SET(lib_path "${project_path}/../../install/libs") + +MESSAGE(STATUS "${Boost_LIBRARY_DIRS}") INCLUDE_DIRECTORIES(${project_path}/uibase/src ${PYTHON_ROOT}/Include @@ -55,6 +57,6 @@ QT5_USE_MODULES(${PROJ_NAME} Widgets) ## Installation INSTALL(TARGETS ${PROJ_NAME} - RUNTIME DESTINATION libs + RUNTIME DESTINATION bin/plugins/data ARCHIVE DESTINATION libs) INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJ_NAME}.pdb DESTINATION pdb) diff --git a/src/runner/pythonrunner.cpp b/src/runner/pythonrunner.cpp index aef6763..bcf7ddc 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -284,7 +284,7 @@ struct QList_to_python_list bpy::list pyList; try { - foreach (const T &item, list) { + for (const T &item : list) { pyList.append(item); } } catch (const bpy::error_already_set&) { @@ -683,6 +683,7 @@ BOOST_PYTHON_MODULE(mobase) bpy::enum_("GameType") .value("oblivion", MOBase::IGameInfo::TYPE_OBLIVION) .value("fallout3", MOBase::IGameInfo::TYPE_FALLOUT3) + .value("fallout4", MOBase::IGameInfo::TYPE_FALLOUT4) .value("falloutnv", MOBase::IGameInfo::TYPE_FALLOUTNV) .value("skyrim", MOBase::IGameInfo::TYPE_SKYRIM) ;