summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tanner <thosrtanner2@users.sourceforge.net>2015-03-22 10:51:43 +0000
committerTom Tanner <thosrtanner2@users.sourceforge.net>2015-03-22 10:51:43 +0000
commit266a6964290033ee86923e96524df8d077d6578a (patch)
tree5acdefbe0d72cee45b05c2ec8988ef49d3dff3b5
parent07b8896f92568083870a5ad61f83e3cb2e4e97ff (diff)
parentea520baf4e4a512744552a8528e3b41145796151 (diff)
Merge
-rw-r--r--.hgignore2
-rw-r--r--README.txt41
-rw-r--r--scons_configure_template.py28
-rw-r--r--src/ModOrganizer.pro5
-rw-r--r--src/SConscript122
-rw-r--r--src/organizer.pro3
-rw-r--r--src/plugincontainer.cpp4
-rw-r--r--src/savegamegamebyro.h3
-rw-r--r--src/savetextasdialog.cpp4
-rw-r--r--src/shared/SConscript25
-rw-r--r--src/shared/shared.pro3
11 files changed, 234 insertions, 6 deletions
diff --git a/.hgignore b/.hgignore
index 0738bd83..f67264ff 100644
--- a/.hgignore
+++ b/.hgignore
@@ -1,4 +1,6 @@
syntax: glob
+scons_configure.py
+scons-ModOrganizer-*
ModOrganizer-build-desktop*
outputd/*
output/*
diff --git a/README.txt b/README.txt
index a4788858..2e14f4d8 100644
--- a/README.txt
+++ b/README.txt
@@ -222,3 +222,44 @@ Troubleshooting (thanks to Ross):
Unlocker: http://www.filehippo.com/download_unlocker/ or http://www.emptyloop.com/unlocker/
Warning: With Unlocker v1.9.2, you must select "Advanced" then uncheck everything to
avoid having some Delta toolbar garbage installed...
+
+5) Problem TT has seen:
+ Complains about 'qtwebkit4' missing. For some reason this seems to insist on
+ living with modorganiser.exe
+
+-------------------
+Building with scons
+-------------------
+
+1) Download scons from www.scons.org and install
+2) Download QT4 (and/or QT5) from https://bitbucket.org/dirkbaechle/scons_qt4 and
+ https://bitbucket.org/dirkbaechle/scons_qt5. Install as per instructions
+3) Copy scons_configure_template.py to scons_configure.py. Edit to point to your
+ boost/python/zlib/7zip paths as appropriate (you can create an empty one if
+ you set up the params in qt creator)
+4) Create build kits as follows:
+ Custom Process step:
+ Command: <python path>\Scripts\scons.bat
+ Arguments: -u .
+ Working directory: %{sourcedir}
+
+ Clean Custom Process step:
+ Command: <python path>\Scripts\scons.bat
+ Arguments: -c -u .
+ Working directory: %{sourcedir}
+
+ For the release build, add 'CONFIG=release' to the arguments.
+
+ If you want to do parallel builds, add -j and a number to the arguments.
+ However you may need to install pywin32 (but it seems to work OK for me).
+ -j 4 did the entire build in 2m 15s. scons uses -Z7 to store debugging
+ information in the .obj files which removes the issues with multiple
+ processes attempting to access one datafile.
+
+ Note. If you want to build a sub project separately, it seems to be better
+ to open the subproject, set that up with the scons kit and build that as a
+ project.
+
+ Please note: the generated (runnable) output files end up in the build directory,
+ in the '_ModOrganizer' subdirectory (not at the top level). Named like that
+ so you can see it!
diff --git a/scons_configure_template.py b/scons_configure_template.py
new file mode 100644
index 00000000..d9cfc2b6
--- /dev/null
+++ b/scons_configure_template.py
@@ -0,0 +1,28 @@
+# This python script contains the configuration for scons
+# Copy this to scons_configure.py and adjust to taste.
+
+# Path to your boost install - it should have a boost/ subdirectory and a stage/
+# subdirectory. The scons script will use stage/lib if there, or the appropriate
+# version for your compiler, if you installed the multiple-build version
+BOOSTPATH = 'C:\\Apps\\boost_1_55_0'
+
+# Version of Visual Studio to use, if you wish to use a specific version. If you
+# don't specify a version, the latest will be picked.. See the scons manual for
+# supported values.
+#MSVC_VERSION = '10.0Exp'
+
+# Path to your python install
+# You don't really need to set this up but you might if (say) you have a 32- and
+# 64-bit python install and scons has been installed for the 64 bit version
+#PYTHONPATH=C:\Apps\Python
+
+# Path to your QT install. This might constrain the version of MSVC you can use.
+# This seems to be set by QTCreator
+#QTDIR = 'C:\\Apps\\Qt\\4.8.6'
+
+# Path to 7-zip sources
+SEVENZIPPATH = 'C:\\Apps\\7-Zip\\7z920'
+
+# Path to zlib. Please read the README file for more information about how this
+# needs to be set up
+ZLIBPATH = 'C:\\Apps\\zlib-1.2.8'
diff --git a/src/ModOrganizer.pro b/src/ModOrganizer.pro
index c0e5d9f5..0ff8b6c5 100644
--- a/src/ModOrganizer.pro
+++ b/src/ModOrganizer.pro
@@ -49,3 +49,8 @@ for(QTNAME, QTLIBNAMES) {
}
INSTALLS += qtlibs otherlibs
+
+OTHER_FILES +=\
+ ../SConstruct\
+ ../scons_configure.py\
+ SConscript
diff --git a/src/SConscript b/src/SConscript
new file mode 100644
index 00000000..1d69c1d6
--- /dev/null
+++ b/src/SConscript
@@ -0,0 +1,122 @@
+import os
+import subprocess
+
+Import('qt_env')
+
+env = qt_env.Clone()
+
+modules = [
+ 'Core',
+ 'Gui',
+ 'Network',
+ 'Script',
+ 'Sql',
+ 'WebKit',
+ 'Xml',
+ 'XmlPatterns',
+ 'Declarative'
+]
+
+if env['QT_MAJOR_VERSION'] > 4:
+ modules += [
+ 'Widgets',
+ 'Qml',
+ 'WebKitWidgets'
+ ]
+
+env.EnableQtModules(*modules)
+
+env.Uic4(env.Glob('*.ui'))
+
+env.RequireLibraries('uibase', 'shared', 'bsatk', 'esptk')
+
+
+env.AppendUnique(LIBS = [
+ 'shell32',
+ 'user32',
+ 'ole32',
+ 'advapi32',
+ 'gdi32',
+ 'shlwapi',
+ 'Psapi',
+ 'Version'
+])
+
+# We have to 'persuade' moc to generate certain other targets and inject them
+# into the list of cpps
+other_sources = env.AddExtraMoc(env.Glob('*.h'))
+
+for file in env.Glob('*.rc'):
+ if file.name == 'version.rc':
+ continue
+ other_sources.append(env.RES(file))
+
+# Note the order of this is important, or you can pick up the wrong report.h...
+# Doing appendunique seems to throw the moc code into a tizzy
+env['CPPPATH'] += [
+ '../archive',
+# '../boss_modified/boss-api',
+ '../plugins/gamefeatures',
+ '.', # Why is this necessary?
+ '${LOOTPATH}',
+ '${BOOSTPATH}',
+]
+
+env.AppendUnique(CPPDEFINES = [
+ '_UNICODE',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_SCL_SECURE_NO_WARNINGS',
+ 'BOOST_DISABLE_ASSERTS',
+ 'NDEBUG',
+ 'QT_MESSAGELOGCONTEXT'
+])
+
+env.AppendUnique(CPPFLAGS = [ '-wd4100', '-wd4127', '-wd4512', '-wd4189' ])
+
+env.AppendUnique(LINKFLAGS = [
+ '/SUBSYSTEM:WINDOWS',
+ '${EXE_MANIFEST_DEPENDENCY}'
+])
+
+# modeltest is optional and it doesn't compile anyway...
+cpp_files = [
+ x for x in Glob('*.cpp')
+ if x.name != 'modeltest.cpp' and x.name != 'aboutdialog.cpp'
+]
+
+about_env = env.Clone()
+hgid = subprocess.check_output(['hg', 'id', '-i']).rstrip()
+# FIXME: It'd be much easier to stringify this in the source code
+about_env.AppendUnique(CPPDEFINES = [ 'HGID=\\"%s\\"' % hgid ])
+other_sources.append(about_env.StaticObject('aboutdialog.cpp'))
+
+env.AppendUnique(LIBPATH = "${ZLIBPATH}/build")
+env.AppendUnique(LIBS = 'zlibstatic')
+
+prog = env.Program('ModOrganizer',
+ cpp_files + env.Glob('*.qrc') + other_sources)
+
+env.InstallModule(prog)
+
+for subdir in ('tutorials', 'stylesheets'):
+ env.Install(os.path.join(env['INSTALL_PATH'], subdir),
+ env.Glob(os.path.join(subdir, '*')))
+
+# FIXME Sort the translations. Except they don't exist on the 1.2 branch
+
+res = env['QT_USED_MODULES']
+Return('res')
+
+"""
+CONFIG(debug, debug|release) {
+} else {
+ QMAKE_CXXFLAGS += /Zi /GL
+ QMAKE_LFLAGS += /DEBUG /LTCG /OPT:REF /OPT:ICF
+}
+
+TRANSLATIONS = organizer_en.ts
+
+
+QMAKE_POST_LINK += xcopy /y /s /I $$quote($$BASEDIR\\*.qm) $$quote($$DSTDIR)\\translations $$escape_expand(\\n)
+
+"""
diff --git a/src/organizer.pro b/src/organizer.pro
index 9300f348..e7177af3 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -360,6 +360,9 @@ CONFIG(debug, debug|release) {
}
}
+OTHER_FILES += \
+ SConscript
+
DISTFILES += \
tutorials/tutorial_primer_main.js \
tutorials/Tooltip.qml \
diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp
index 6bc9d12b..e1d9d9f0 100644
--- a/src/plugincontainer.cpp
+++ b/src/plugincontainer.cpp
@@ -266,7 +266,7 @@ void PluginContainer::loadPlugins()
loadCheck.flush();
QString pluginName = iter.filePath();
if (QLibrary::isLibrary(pluginName)) {
- QPluginLoader *pluginLoader = new QPluginLoader(pluginName, this);
+ std::unique_ptr<QPluginLoader> pluginLoader(new QPluginLoader(pluginName, this));
if (pluginLoader->instance() == nullptr) {
m_FailedPlugins.push_back(pluginName);
qCritical("failed to load plugin %s: %s",
@@ -274,7 +274,7 @@ void PluginContainer::loadPlugins()
} else {
if (registerPlugin(pluginLoader->instance(), pluginName)) {
qDebug("loaded plugin \"%s\"", qPrintable(pluginName));
- m_PluginLoaders.push_back(pluginLoader);
+ m_PluginLoaders.push_back(pluginLoader.release());
} else {
m_FailedPlugins.push_back(pluginName);
qWarning("plugin \"%s\" failed to load", qPrintable(pluginName));
diff --git a/src/savegamegamebyro.h b/src/savegamegamebyro.h
index eedda6c2..e08e1044 100644
--- a/src/savegamegamebyro.h
+++ b/src/savegamegamebyro.h
@@ -22,10 +22,9 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "savegame.h"
-#include <gameinfo.h>
+
#include <QString>
#include <QObject>
-#include <QImage>
#include <QMetaType>
#include <QFile>
diff --git a/src/savetextasdialog.cpp b/src/savetextasdialog.cpp
index 1f23356f..1a940094 100644
--- a/src/savetextasdialog.cpp
+++ b/src/savetextasdialog.cpp
@@ -1,6 +1,6 @@
#include "savetextasdialog.h"
#include "ui_savetextasdialog.h"
-#include <report.h>
+#include "report.h"
#include <QClipboard>
#include <QFileDialog>
@@ -37,7 +37,7 @@ void SaveTextAsDialog::on_saveAsBtn_clicked()
if (!fileName.isEmpty()) {
QFile file(fileName);
if (!file.open(QIODevice::WriteOnly)) {
- MOBase::reportError(tr("failed to open \"%1\" for writing").arg(fileName));
+ reportError(tr("failed to open \"%1\" for writing").arg(fileName));
return;
}
diff --git a/src/shared/SConscript b/src/shared/SConscript
new file mode 100644
index 00000000..69a95289
--- /dev/null
+++ b/src/shared/SConscript
@@ -0,0 +1,25 @@
+Import('qt_env')
+
+env = qt_env.Clone()
+
+env.EnableQtModules('Core', 'Gui')
+
+env.AppendUnique(CPPDEFINES = [
+ 'UNICODE',
+ '_UNICODE',
+ '_CRT_SECURE_NO_WARNINGS',
+ 'BOOST_DISABLE_ASSERTS',
+ 'NDEBUG'
+])
+
+env.AppendUnique(CPPPATH = [
+ '../bsatk',
+ '${BOOSTPATH}',
+ '.' # Seriously!
+])
+
+# Not sure if renaming this helps much as it's static
+env.StaticLibrary('mo_shared', env.Glob('*.cpp'))
+
+res = env['QT_USED_MODULES']
+Return('res')
diff --git a/src/shared/shared.pro b/src/shared/shared.pro
index 1e26b7c0..646c2c3e 100644
--- a/src/shared/shared.pro
+++ b/src/shared/shared.pro
@@ -73,3 +73,6 @@ DEFINES += BOOST_DISABLE_ASSERTS NDEBUG
# QMAKE_CXXFLAGS += /analyze
INCLUDEPATH += ../bsatk "$${BOOSTPATH}"
+
+OTHER_FILES += \
+ SConscript