From 0d50427b8389ade7e01b653494afa2b204e3a83c Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Wed, 30 Dec 2015 16:24:47 +0000 Subject: Patch to build with QT5.5 --- SConstruct | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 013375b7..76852c41 100644 --- a/SConstruct +++ b/SConstruct @@ -532,7 +532,8 @@ if qt_env['CONFIG'] != 'debug': qt_env.AppendUnique(CPPDEFINES = [ 'QT_NO_DEBUG' ]) # Better way of working this out -qt_env['QT_MAJOR_VERSION'] = 5 #int(os.path.basename(env['QTDIR']).split('.')[0]) +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']) @@ -648,8 +649,10 @@ if 'WebKit' in libs_to_install and qt_env['QT_MAJOR_VERSION'] == 4: if qt_env['QT_MAJOR_VERSION'] > 4: # Guesswork a bit. dlls_to_install += [ - os.path.join(env['QTDIR'], 'bin', 'icu%s53.dll' % lib) - for lib in ('dt','in', 'uc') + os.path.join(env['QTDIR'], + 'bin', + 'icu%s%d%d.dll' % (lib, qt_env['QT_MAJOR_VERSION'], qt_env['QT_MINOR_VERSION'] - 1)) + for lib in ('dt','in', 'uc') ] platform_dlls = [] -- cgit v1.3.1 From 197c49e996ba6f1284a7b7369b294000450b4453 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Thu, 31 Dec 2015 23:06:52 +0000 Subject: Fixes for building with qt5.5 --- SConstruct | 22 +++++++++++++--------- massage_messages.py | 14 +++++++++++--- qt5_4.imp | 2 +- win.imp | 10 +++++++++- 4 files changed, 34 insertions(+), 14 deletions(-) (limited to 'SConstruct') 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 diff --git a/massage_messages.py b/massage_messages.py index d79f4cea..0a3ee9ad 100644 --- a/massage_messages.py +++ b/massage_messages.py @@ -36,6 +36,7 @@ includes = dict() adding = None added = dict() +lcadded = dict() foundline = None @@ -70,6 +71,7 @@ def process_next_line(line, outfile): m = re.match(r'.*class (.*);', line) if m: added[m.group(1)] = (adding, line) + lcadded[m.group(1).lower() + '.h'] = m.group(1) else: added[line] = (adding, line) elif removing: @@ -79,12 +81,18 @@ def process_next_line(line, outfile): m = re.match(r'- #include [<"](.*)[">] +// lines (.*)-', line) if m: foundline = m.group(2) - if m.group(1) in added: + # Note: In this project at least we have a naming convention of + # lower case filename and upper case classname. + clname = m.group(1) + if clname not in added: + if clname in lcadded: + clname = lcadded[clname] + if clname in added: messages[removing].append( '%s(%s) : warning I0004: Replace include of %s with ' 'forward reference %s' % ( - removing, m.group(2), m.group(1), added[m.group(1)][1])) - del added[m.group(1)] + removing, m.group(2), m.group(1), added[clname][1])) + del added[clname] else: messages[removing].append( '%s(%s) : warning I0001: Unnecessary include of %s' % ( diff --git a/qt5_4.imp b/qt5_4.imp index 22553b0e..5f919085 100644 --- a/qt5_4.imp +++ b/qt5_4.imp @@ -2463,7 +2463,7 @@ { include: [ "@\"(QtCore/)?qglobal\\.h\"", "private", "", "public" ] }, { include: [ "@\"(QtCore/)?qnamespace\\.h\"", "private", "", "public" ] }, { include: [ "@\"(QtCore/)?qlogging\\.h\"", "private", "", "public" ] }, #qDebug, qWarning, etc - { include: [ "@\"(QtCore/)?qalgorithms\\.h\"", "private", "", "public" ] }, #qSort, etc + { include: [ "@\"(QtCore/)?qalgorithms\\.h\"", "private", "", "public" ] }, #qSort, etc { include: [ "@\"(QtWinExtras/)?qwinfunctions\\.h\"", "private", "", "public" ] }, # for fromHICON # These ones are just madness. For instance, why with the above do we get diff --git a/win.imp b/win.imp index cbecdc43..24635775 100644 --- a/win.imp +++ b/win.imp @@ -54,10 +54,18 @@ { include: [ "", "private", "", "public" ] }, # official name according to website { include: [ "", "private", "", "public" ] }, # - { include: [ "", "private", "", "public" ] }, { include: [ "", "private", "", "public" ] }, { include: [ "", "private", "", "public" ] }, +# These ones are in shtypes.h but the only documentation I can find says +# to include Knownfolders.h for these + { symbol: [ "REFKNOWNFOLDERID", "private", "", "public" ] }, + { symbol: [ "KNOWNFOLDERID", "private", "", "public" ] }, + +# IWYU doesn't understand upper/lower case which is *really* annoying on +# windows, though to be fair I'm not sure M/S understand it either. + { include: [ "", "private", "", "public" ] }, + # Files that are included by other files which seem to then come for free in Windows.h but # shouldn't. Again, should be cleaned up. -- cgit v1.3.1 From 387326f2d62fe02babe3594e2e00f831355da9b7 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Sat, 23 Jan 2016 07:29:06 +0000 Subject: thoughts --- SConstruct | 14 ++++++++++++++ src/organizercore.h | 2 +- src/organizerproxy.cpp | 5 +++++ src/organizerproxy.h | 1 + 4 files changed, 21 insertions(+), 1 deletion(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index b52cf509..c7248251 100644 --- a/SConstruct +++ b/SConstruct @@ -623,6 +623,20 @@ if qt_env['QT_MAJOR_VERSION'] > 4: ] # Finally, set up rules to install the DLLs. +# use windeployqt.exe to install all required libraries +#SET(windeploy_parameters --no-translations --no-plugins --libdir dlls --release-with-debug-info --no-compiler-runtime) +#INSTALL( +# CODE +# "EXECUTE_PROCESS( +# COMMAND +# ${qt5bin}/windeployqt.exe ModOrganizer.exe ${windeploy_parameters} +# COMMAND +# ${qt5bin}/windeployqt.exe uibase.dll ${windeploy_parameters} +# WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin +# )" +#) +# this should probably be a rule though it seems to produce an awful lot of +# Stuff(TM). or a postaction dll_path = os.path.join('$INSTALL_PATH', 'DLLs') diff --git a/src/organizercore.h b/src/organizercore.h index 5cfbaca4..f4cfabe7 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -89,7 +89,7 @@ public: m_ExecutablesList = executablesList; } - Profile *currentProfile() { return m_CurrentProfile; } + Profile *currentProfile() const { return m_CurrentProfile; } void setCurrentProfile(const QString &profileName); std::vector enabledArchives(); diff --git a/src/organizerproxy.cpp b/src/organizerproxy.cpp index ba07c154..b289b659 100644 --- a/src/organizerproxy.cpp +++ b/src/organizerproxy.cpp @@ -166,6 +166,11 @@ MOBase::IModList *OrganizerProxy::modList() const return m_Proxied->modList(); } +MOBase::IProfile *OrganizerProxy::profile() const +{ + return m_Proxied->currentProfile(); +} + MOBase::IPluginGame const *OrganizerProxy::managedGame() const { return m_Proxied->managedGame(); diff --git a/src/organizerproxy.h b/src/organizerproxy.h index 62a35498..95543ba3 100644 --- a/src/organizerproxy.h +++ b/src/organizerproxy.h @@ -37,6 +37,7 @@ public: virtual MOBase::IDownloadManager *downloadManager() const; virtual MOBase::IPluginList *pluginList() const; virtual MOBase::IModList *modList() const; + virtual MOBase::IProfile *profile() const override; virtual HANDLE startApplication(const QString &executable, const QStringList &args = QStringList(), const QString &cwd = "", const QString &profile = ""); virtual bool waitForApplication(HANDLE handle, LPDWORD exitCode = nullptr) const; virtual void refreshModList(bool saveChanges); -- cgit v1.3.1