From 82909001c4d9d081da2f08099fefdb71edd96bed Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Fri, 3 Dec 2021 07:28:09 +0100 Subject: [PATCH] Build fixes with pymod --- src/gsiqt/qtbasic/gsiQtCore5CompatExternals.h | 25 ++++++++++++++++ src/pymod/QtCore5Compat/QtCore5Compat.pro | 11 +++++++ src/pymod/QtCore5Compat/QtCore5CompatMain.cc | 29 +++++++++++++++++++ src/pymod/bridge_sample/bridge_sample.pro | 3 ++ src/pymod/pymod.pro | 14 +++++++-- 5 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 src/gsiqt/qtbasic/gsiQtCore5CompatExternals.h create mode 100644 src/pymod/QtCore5Compat/QtCore5Compat.pro create mode 100644 src/pymod/QtCore5Compat/QtCore5CompatMain.cc diff --git a/src/gsiqt/qtbasic/gsiQtCore5CompatExternals.h b/src/gsiqt/qtbasic/gsiQtCore5CompatExternals.h new file mode 100644 index 000000000..e6842fa37 --- /dev/null +++ b/src/gsiqt/qtbasic/gsiQtCore5CompatExternals.h @@ -0,0 +1,25 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2021 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#if QT_VERSION >= 0x060000 +# include "../qt6/QtCore5Compat/gsiQtExternals.h" +#endif diff --git a/src/pymod/QtCore5Compat/QtCore5Compat.pro b/src/pymod/QtCore5Compat/QtCore5Compat.pro new file mode 100644 index 000000000..fdf84e1f4 --- /dev/null +++ b/src/pymod/QtCore5Compat/QtCore5Compat.pro @@ -0,0 +1,11 @@ + +TARGET = QtCore5Compat + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtCore5CompatMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtCore5Compat -lklayout_QtNetwork diff --git a/src/pymod/QtCore5Compat/QtCore5CompatMain.cc b/src/pymod/QtCore5Compat/QtCore5CompatMain.cc new file mode 100644 index 000000000..ddc5f79f1 --- /dev/null +++ b/src/pymod/QtCore5Compat/QtCore5CompatMain.cc @@ -0,0 +1,29 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2021 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "../pymodHelper.h" + +// To force linking of the QtCore5Compat module +#include "../../gsiqt/qtbasic/gsiQtCore5CompatExternals.h" +FORCE_LINK_GSI_QTCORE5COMPAT + +DEFINE_PYMOD(QtCore5Compat, "QtCore5Compat", "KLayout/Qt module 'QtCore5Compat'") diff --git a/src/pymod/bridge_sample/bridge_sample.pro b/src/pymod/bridge_sample/bridge_sample.pro index abbf68470..73ed68054 100644 --- a/src/pymod/bridge_sample/bridge_sample.pro +++ b/src/pymod/bridge_sample/bridge_sample.pro @@ -48,6 +48,9 @@ equals(HAVE_QT, "0") { } else { # Include QtCore required for some includes QT = core + greaterThan (QT_MAJOR_VERSION, 5) { + QT += core5compat + } DEFINES += HAVE_QT } diff --git a/src/pymod/pymod.pro b/src/pymod/pymod.pro index 7b140159f..cb205bcdb 100644 --- a/src/pymod/pymod.pro +++ b/src/pymod/pymod.pro @@ -35,7 +35,9 @@ SUBDIRS = \ } !equals(HAVE_QT_XML, "0") { - SUBDIRS += QtXmlPatterns + lessThan(QT_MAJOR_VERSION, 6) { + SUBDIRS += QtXmlPatterns + } } } @@ -53,13 +55,21 @@ SUBDIRS = \ } !equals(HAVE_QT_DESIGNER, "0") { - SUBDIRS += QtDesigner + lessThan(QT_MAJOR_VERSION, 6) { + SUBDIRS += QtDesigner + } } !equals(HAVE_QT_UITOOLS, "0") { SUBDIRS += QtUiTools } + greaterThan(QT_MAJOR_VERSION, 5) { + !equals(HAVE_QT_CORE5COMPAT, "0") { + SUBDIRS += QtCore5Compat + } + } + } }