summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorThomas Tanner <trtanner@btinternet.com>2015-12-31 23:06:52 +0000
committerThomas Tanner <trtanner@btinternet.com>2015-12-31 23:06:52 +0000
commit197c49e996ba6f1284a7b7369b294000450b4453 (patch)
tree065ec22e1f43281a886cb7a0e63b9184a85f6b8f /SConstruct
parent0d50427b8389ade7e01b653494afa2b204e3a83c (diff)
Fixes for building with qt5.5
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct22
1 files changed, 13 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index 76852c41..b52cf509 100644
--- a/SConstruct
+++ b/SConstruct
@@ -431,16 +431,24 @@ msvs_version = int(env['MSVS_VERSION'].split('.')[0]) + 2000
if msvs_version > 2010:
msvs_version += 1
-# Need more work on the qt version stuff
-#build-ModOrganizer-Desktop_Qt_5_4_1_MSVC2013_OpenGL_32bit-Debug
-build_dir = 'scons-ModOrganizer-QT_%s_for_MSVS%d_32bit-%s' % (
- #os.path.basename(env['QTDIR']).replace('.', '_'),
- '5_4_1_OpenGL',
+# Read the QT version info
+with open(os.path.join(env['QTDIR'], 'mkspecs', 'qconfig.pri')) as qtinfo:
+ for line in qtinfo:
+ info = re.split(r'\s*=\s*', line.rstrip())
+ if info[0] == 'QT_VERSION':
+ env[info[0]] = info[1]
+ elif '_VERSION' in info[0]:
+ env[info[0]] = int(info[1])
+
+build_dir = 'scons-ModOrganizer-QT_%s_%sfor_MSVS%d_32bit-%s' % (
+ env['QT_VERSION'].replace('.', '_'),
+ 'OpenGL_' if 'opengl' in env['QTDIR'] else '',
msvs_version,
config.title())
# Put the sconsign file somewhere sane
env.SConsignFile(os.path.join(build_dir, '.sconsign.dblite'))
+env.CacheDir(os.path.join(build_dir, '.cache'))
#this doesn't seem to work
#env.VariantDir('build/$CONFIG', 'source')
@@ -531,10 +539,6 @@ qt_env = env.Clone()
if qt_env['CONFIG'] != 'debug':
qt_env.AppendUnique(CPPDEFINES = [ 'QT_NO_DEBUG' ])
-# Better way of working this out
-qt_env['QT_MAJOR_VERSION'] = int(os.path.basename(os.path.dirname(env['QTDIR'])).split('.')[0])
-qt_env['QT_MINOR_VERSION'] = int(os.path.basename(os.path.dirname(env['QTDIR'])).split('.')[1])
-
qt_env.Tool('qt%d' % qt_env['QT_MAJOR_VERSION'])
# FIXME See if I can work out how to get official scons qt to work. Appears