summaryrefslogtreecommitdiff
path: root/src/SConscript
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 /src/SConscript
parent8eb63a068ccae5dca755a5e6f0607ecacbddb4a2 (diff)
parent39dd67f22f236d9f962657abe5b619f2b338f2fc (diff)
Merge in changes by Tom Tanner
Diffstat (limited to 'src/SConscript')
-rw-r--r--src/SConscript119
1 files changed, 119 insertions, 0 deletions
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)
+
+"""