summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2015-03-27 18:24:37 +0100
committerTannin <devnull@localhost>2015-03-27 18:24:37 +0100
commit0d5197a3c886abfbda9ca3cbc08ddac127a4160c (patch)
tree726e33399014845264454e8b09c4376be59e5b56
parent8eb63a068ccae5dca755a5e6f0607ecacbddb4a2 (diff)
parent39dd67f22f236d9f962657abe5b619f2b338f2fc (diff)
Merge in changes by Tom Tanner
-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/SConscript119
-rw-r--r--src/organizer.pro3
-rw-r--r--src/shared/SConscript22
-rw-r--r--src/shared/shared.pro3
8 files changed, 222 insertions, 1 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..2eeb869e
--- /dev/null
+++ b/src/SConscript
@@ -0,0 +1,119 @@
+import os
+import subprocess
+
+Import('qt_env')
+
+env = qt_env.Clone()
+
+modules = [
+ 'Core',
+ 'Gui',
+ 'Network',
+ 'Script',
+ 'Sql',
+ 'WebKit',
+ 'Xml',
+ 'XmlPatterns'
+]
+
+if env['QT_MAJOR_VERSION'] > 4:
+ modules += [
+ 'Widgets',
+ 'Qml',
+ 'Quick',
+ 'WebKitWidgets'
+ ]
+else:
+ modules += [
+ 'Declarative'
+ ]
+
+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',
+ '.', # Why is this necessary?
+ '${BOOSTPATH}',
+]
+
+env.AppendUnique(CPPDEFINES = [
+ '_UNICODE',
+ '_CRT_SECURE_NO_WARNINGS',
+ '_SCL_SECURE_NO_WARNINGS',
+ 'NOMINMAX',
+ 'BOOST_DISABLE_ASSERTS',
+# Although the .pro file says it adds this, the compile line doesn't seem to
+# have it (unless it's in the annoying '@' file
+# 'NDEBUG'
+])
+
+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'))
+
+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
+
+"""
+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..e2a0914b 100644
--- a/src/organizer.pro
+++ b/src/organizer.pro
@@ -363,4 +363,5 @@ CONFIG(debug, debug|release) {
DISTFILES += \
tutorials/tutorial_primer_main.js \
tutorials/Tooltip.qml \
- tutorials/TooltipArea.qml
+ tutorials/TooltipArea.qml \
+ SConscript
diff --git a/src/shared/SConscript b/src/shared/SConscript
new file mode 100644
index 00000000..35c65d73
--- /dev/null
+++ b/src/shared/SConscript
@@ -0,0 +1,22 @@
+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'))
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