mirror of
https://github.com/ModOrganizer2/modorganizer-plugin_python.git
synced 2026-07-27 14:03:33 -07:00
Update following cmake_common changes.
# Conflicts: # CMakeLists.txt # src/runner/CMakeLists.txt # src/runner/pythonRunner.pro # src/runner/pythonrunner_en.ts
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
[submodule "lib/pyind11"]
|
||||
path = lib/pyind11
|
||||
url = https://github.com/pybind/pybind11
|
||||
+5
-10
@@ -1,18 +1,13 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(plugin_python)
|
||||
set(project_type plugin)
|
||||
set(enable_warnings OFF)
|
||||
set(create_translations ON)
|
||||
|
||||
set(additional_translations "${CMAKE_SOURCE_DIR}/src/runner")
|
||||
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/project.cmake)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/mo2.cmake)
|
||||
else()
|
||||
include(../cmake_common/project.cmake)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/../cmake_common/mo2.cmake)
|
||||
endif()
|
||||
|
||||
add_subdirectory(src/proxy)
|
||||
project(plugin_python)
|
||||
|
||||
# order matters!
|
||||
add_subdirectory(src/runner)
|
||||
add_subdirectory(src/proxy)
|
||||
|
||||
Submodule
+1
Submodule lib/pyind11 added at c4e295287b
@@ -1,12 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
# appveyor does not build modorganizer in its standard location, so use
|
||||
# DEPENDENCIES_DIR to find cmake_common
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/src.cmake)
|
||||
else()
|
||||
include(../../../cmake_common/src.cmake)
|
||||
endif()
|
||||
|
||||
requires_library(python)
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/src/runner)
|
||||
add_library(plugin_python SHARED)
|
||||
mo2_configure_plugin(plugin_python WARNINGS OFF TRANSLATIONS OFF)
|
||||
target_link_libraries(plugin_python PRIVATE pythonrunner)
|
||||
mo2_install_target(plugin_python)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
import os
|
||||
|
||||
Import('qt_env')
|
||||
|
||||
env = qt_env.Clone()
|
||||
|
||||
env.AppendUnique(CPPDEFINES = [
|
||||
'PROXYPYTHON_LIBRARY',
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
'_SCL_SECURE_NO_WARNINGS'
|
||||
])
|
||||
|
||||
env.AppendUnique(CPPPATH = [
|
||||
'${BOOSTPATH}',
|
||||
'..\\..\\pythonRunner'
|
||||
])
|
||||
|
||||
env.AppendUnique(LIBS = 'shell32')
|
||||
|
||||
runner = env.File(os.path.join('..', '..', 'pythonRunner', 'pythonRunner.dll'))
|
||||
|
||||
runner_env = env.Clone()
|
||||
runner_env.AppendUnique(CPPDEFINES = 'SCONS_BUILD')
|
||||
runner_env.AppendUnique(CPPPATH = runner.dir)
|
||||
|
||||
# There's a whole load of unused C++ files in here.
|
||||
lib = env.SharedLibrary('proxyPython', [ 'proxypython.cpp' ])
|
||||
|
||||
env.InstallModule(lib)
|
||||
|
||||
res = env['QT_USED_MODULES']
|
||||
Return('res')
|
||||
@@ -1,48 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-04-05T18:26:04
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
|
||||
TARGET = proxyPython
|
||||
TEMPLATE = lib
|
||||
|
||||
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
|
||||
CONFIG += plugins
|
||||
CONFIG += dll
|
||||
|
||||
CONFIG(release, debug|release) {
|
||||
QMAKE_CXXFLAGS += /Zi
|
||||
QMAKE_LFLAGS += /DEBUG
|
||||
}
|
||||
|
||||
DEFINES += PROXYPYTHON_LIBRARY
|
||||
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
DEFINES += _SCL_SECURE_NO_WARNINGS
|
||||
|
||||
SOURCES += proxypython.cpp
|
||||
HEADERS += proxypython.h \
|
||||
resource.h
|
||||
|
||||
OTHER_FILES += \
|
||||
proxypython.json \
|
||||
SConscript
|
||||
|
||||
RC_FILE +=
|
||||
|
||||
include(../plugin_template.pri)
|
||||
|
||||
INCLUDEPATH += "../../pythonRunner" "$${BOOSTPATH}"
|
||||
|
||||
WINPWD = $$PWD
|
||||
WINPWD ~= s,/,$$QMAKE_DIR_SEP,g
|
||||
|
||||
#QMAKE_POST_LINK += SET VS90COMNTOOLS=%VS100COMNTOOLS% $$escape_expand(\\n)
|
||||
|
||||
|
||||
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\sip.pyd $$quote($$DSTDIR)\\plugins\\data\\ $$escape_expand(\\n)
|
||||
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtCore.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
|
||||
#QMAKE_POST_LINK += copy $$(PYTHONPATH)\\lib\\site-packages\\PyQt4\\QtGui.pyd $$quote($$DSTDIR)\\plugins\\data\\PyQt4\\ $$escape_expand(\\n)
|
||||
+23
-25
@@ -1,30 +1,28 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
project(pythonrunner)
|
||||
set(project_type plugin)
|
||||
set(enable_warnings OFF)
|
||||
set(enable_bigobj ON)
|
||||
set(install_dir bin/plugins/data)
|
||||
set(create_translations OFF)
|
||||
# need to find Boost here with a dummy component to get Boost_LIBRARY_DIRS
|
||||
find_package(Boost COMPONENTS thread REQUIRED)
|
||||
|
||||
add_compile_definitions(
|
||||
QT_NO_KEYWORDS
|
||||
PYTHONRUNNER_LIBRARY)
|
||||
add_library(pythonrunner SHARED)
|
||||
mo2_configure_library(pythonrunner
|
||||
WARNINGS OFF
|
||||
BIGOBJ ON
|
||||
AUTOMOC ON
|
||||
TRANSLATIONS OFF
|
||||
PRIVATE_DEPENDS uibase boost Qt::Core
|
||||
)
|
||||
target_include_directories(pythonrunner PRIVATE ${PYTHON_ROOT}/Include)
|
||||
|
||||
# appveyor does not build modorganizer in its standard location, so use
|
||||
# DEPENDENCIES_DIR to find cmake_common
|
||||
if(DEFINED DEPENDENCIES_DIR)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/project.cmake)
|
||||
include(${DEPENDENCIES_DIR}/modorganizer_super/cmake_common/src.cmake)
|
||||
else()
|
||||
include(../../../cmake_common/project.cmake)
|
||||
include(../../../cmake_common/src.cmake)
|
||||
endif()
|
||||
# this is kind of broken but it only works with this...
|
||||
target_link_directories(pythonrunner
|
||||
PRIVATE
|
||||
${MO2_INSTALL_LIBS_PATH}
|
||||
${Boost_LIBRARY_DIRS})
|
||||
target_compile_definitions(pythonrunner
|
||||
PRIVATE QT_NO_KEYWORDS PYTHONRUNNER_LIBRARY)
|
||||
mo2_install_target(pythonrunner INSTALLDIR bin/plugins/data)
|
||||
|
||||
requires_project(game_features)
|
||||
requires_library(python)
|
||||
|
||||
add_filter(NAME src/converters GROUPS
|
||||
mo2_add_filter(NAME src/converters GROUPS
|
||||
converters
|
||||
pythonutils
|
||||
shared_ptr_converter
|
||||
@@ -32,19 +30,19 @@ add_filter(NAME src/converters GROUPS
|
||||
variant_helper
|
||||
)
|
||||
|
||||
add_filter(NAME src/runner GROUPS
|
||||
mo2_add_filter(NAME src/runner GROUPS
|
||||
pythonrunner
|
||||
pylogger
|
||||
widgets
|
||||
)
|
||||
|
||||
add_filter(NAME src/utils GROUPS
|
||||
mo2_add_filter(NAME src/utils GROUPS
|
||||
error
|
||||
gilock
|
||||
sipapiaccess
|
||||
)
|
||||
|
||||
add_filter(NAME src/wrappers GROUPS
|
||||
mo2_add_filter(NAME src/wrappers GROUPS
|
||||
gamefeatureswrappers
|
||||
proxypluginwrappers
|
||||
pythonwrapperutilities
|
||||
|
||||
@@ -1,63 +0,0 @@
|
||||
Import('qt_env')
|
||||
|
||||
env = qt_env.Clone()
|
||||
|
||||
env.EnableQtModules('Core', 'Gui', 'Widgets')
|
||||
|
||||
env.AppendUnique(CPPDEFINES = 'PYTHONRUNNER_LIBRARY')
|
||||
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
# NB HAVE_ROUND causes a warning because it's defined in pythonrunner.cpp
|
||||
env.AppendUnique(CPPDEFINES = [
|
||||
'_SCL_SECURE_NO_WARNINGS',
|
||||
'HAVE_ROUND'
|
||||
])
|
||||
|
||||
# Boost produces very long names with msvc truncates. Doesn't seem to cause
|
||||
# problems.
|
||||
env.AppendUnique(CPPFLAGS = [ '-wd4503' ])
|
||||
|
||||
# QMAKE_CXXFLAGS += /Zi
|
||||
# QMAKE_LFLAGS += /DEBUG
|
||||
|
||||
env.RequireLibraries('uibase')
|
||||
|
||||
# AppendUnique appears not to work with QT4
|
||||
env['CPPPATH'] += [
|
||||
'${BOOSTPATH}',
|
||||
'${PYTHONPATH}\\include',
|
||||
]
|
||||
|
||||
env.AppendUnique(LIBS = [
|
||||
'python27', # Could be done better
|
||||
])
|
||||
|
||||
env.AppendUnique(LIBPATH = [
|
||||
'${PYTHONPATH}/libs', # Could be done better
|
||||
])
|
||||
|
||||
# We have to 'persuade' moc to generate certain other targets and inject them
|
||||
# into the list of cpps
|
||||
targets = env.AddExtraMoc(env.Glob('*.h'))
|
||||
|
||||
# pythontoolwrapper doesnt compile and isn't in the project file
|
||||
cpp_files = [
|
||||
x for x in Glob('*.cpp') if x.name != 'pythontoolwrapper.cpp'
|
||||
]
|
||||
|
||||
lib = env.SharedLibrary('pythonRunner', cpp_files + targets)
|
||||
|
||||
env.InstallModule(lib, 'plugins/data')
|
||||
|
||||
# However...
|
||||
# we do need boost-python and pythonvv.dll and pythonvv.zip (though the last
|
||||
# isn't needed to just bring up the module)
|
||||
#env.Pseudo('install')
|
||||
#env.Depends('install',
|
||||
# (env.Install('${INSTALL_PATH}', 'pyCfg.py'),
|
||||
# env.Install(os.path.join('${INSTALL_PATH}', 'data'),
|
||||
# ( ui, rc, 'settings.json' )),
|
||||
# ))
|
||||
|
||||
res = env['QT_USED_MODULES']
|
||||
Return('res')
|
||||
@@ -1,66 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2013-09-01T15:55:01
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
TARGET = pythonRunner
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG += dll
|
||||
CONFIG += warn_on
|
||||
QT += widgets
|
||||
|
||||
DEFINES += PYTHONRUNNER_LIBRARY
|
||||
|
||||
# suppress a few warnings caused by boost vs vc++ paranoia
|
||||
DEFINES += _SCL_SECURE_NO_WARNINGS HAVE_ROUND NOMINMAX
|
||||
|
||||
|
||||
!include(../LocalPaths.pri) {
|
||||
message("paths to required libraries need to be set up in LocalPaths.pri")
|
||||
}
|
||||
|
||||
SOURCES += pythonrunner.cpp \
|
||||
gilock.cpp \
|
||||
error.cpp \
|
||||
pythonpluginwrapper.cpp \
|
||||
proxypluginwrappers.cpp
|
||||
|
||||
HEADERS += pythonrunner.h \
|
||||
gilock.h \
|
||||
error.h \
|
||||
uibasewrappers.h \
|
||||
pythonpluginwrapper.h \
|
||||
proxypluginwrappers.h
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
LIBS += -L$$OUT_PWD/../uibase/debug
|
||||
} else {
|
||||
LIBS += -L$$OUT_PWD/../uibase/release
|
||||
msvc:QMAKE_CXXFLAGS += /Zi
|
||||
msvc:QMAKE_LFLAGS += /DEBUG
|
||||
}
|
||||
|
||||
INCLUDEPATH += "$${BOOSTPATH}" "$${PYTHONPATH}/include" "$${PYTHONPATH}/Lib/site-packages/PyQt6/include" ../uibase
|
||||
LIBS += -L"$${PYTHONPATH}/libs" -L"$${BOOSTPATH}/stage/lib"
|
||||
LIBS += -lpython27
|
||||
LIBS += -luibase
|
||||
|
||||
CONFIG(debug, debug|release) {
|
||||
SRCDIR = $$OUT_PWD/debug
|
||||
DSTDIR = $$PWD/../../outputd
|
||||
} else {
|
||||
SRCDIR = $$OUT_PWD/release
|
||||
DSTDIR = $$PWD/../../output
|
||||
}
|
||||
|
||||
SRCDIR ~= s,/,$$QMAKE_DIR_SEP,g
|
||||
DSTDIR ~= s,/,$$QMAKE_DIR_SEP,g
|
||||
|
||||
QMAKE_POST_LINK += xcopy /y /s /i $$quote($$SRCDIR\\$${TARGET}*.dll) $$quote($$DSTDIR)\\plugins\\data $$escape_expand(\\n)
|
||||
QMAKE_POST_LINK += xcopy /y /I $$quote($$SRCDIR\\$${TARGET}*.pdb) $$quote($$DSTDIR)\\plugins $$escape_expand(\\n)
|
||||
|
||||
OTHER_FILES += \
|
||||
SConscript\
|
||||
CMakeLists.txt
|
||||
@@ -37,6 +37,9 @@
|
||||
#include <boost/mp11.hpp>
|
||||
#endif
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <fmt/xchar.h>
|
||||
|
||||
#include "tuple_helper.h"
|
||||
#include "variant_helper.h"
|
||||
#include "converters.h"
|
||||
|
||||
Reference in New Issue
Block a user