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/src/proxy/CMakeLists.txt b/src/proxy/CMakeLists.txt index 3dd8519..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) @@ -31,9 +33,9 @@ SET(lib_path "${project_path}/../../install/libs") ADD_DEFINITIONS(-DUNICODE -D_UNICODE) INCLUDE_DIRECTORIES(${project_path}/uibase/src - ${project_path}/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 1000cbe..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}) @@ -57,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 36f679a..b04c768 100644 --- a/src/runner/pythonrunner.cpp +++ b/src/runner/pythonrunner.cpp @@ -291,7 +291,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&) {