WIP: more Qt Python modules and better build scheme.

This commit is contained in:
Matthias Koefferlein 2018-06-02 00:50:57 +02:00
parent 1840e74d0d
commit 3cabb23be1
25 changed files with 390 additions and 61 deletions

View File

@ -1,21 +1,11 @@
LIBDIR = $$OUT_PWD/../..
DESTDIR = $$LIBDIR/pymod
TARGET = QtCore
include($$PWD/../../lib.pri)
include($$PWD/../pymod.pri)
SOURCES = \
QtCoreMain.cc \
HEADERS += \
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_db -lklayout_gsi -lklayout_pya -lklayout_QtCore
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
LIBS += -lklayout_QtCore

View File

@ -0,0 +1,11 @@
TARGET = QtDesigner
include($$PWD/../pymod.pri)
SOURCES = \
QtDesignerMain.cc \
HEADERS += \
LIBS += -lklayout_QtDesigner

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtDesigner, "QtDesigner", "KLayout/Qt module 'QtDesigner'")

View File

@ -1,21 +1,11 @@
LIBDIR = $$OUT_PWD/../..
DESTDIR = $$LIBDIR/pymod
TARGET = QtGui
include($$PWD/../../lib.pri)
include($$PWD/../pymod.pri)
SOURCES = \
QtGuiMain.cc \
HEADERS += \
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_db -lklayout_gsi -lklayout_pya -lklayout_QtGui -lklayout_QtCore
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
LIBS += -lklayout_QtGui

View File

@ -0,0 +1,11 @@
TARGET = QtMultimedia
include($$PWD/../pymod.pri)
SOURCES = \
QtMultimediaMain.cc \
HEADERS += \
LIBS += -lklayout_QtMultimedia

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtMultimedia, "QtMultimedia", "KLayout/Qt module 'QtMultimedia'")

View File

@ -0,0 +1,11 @@
TARGET = QtNetwork
include($$PWD/../pymod.pri)
SOURCES = \
QtNetworkMain.cc \
HEADERS += \
LIBS += -lklayout_QtNetwork

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtNetwork, "QtNetwork", "KLayout/Qt module 'QtNetwork'")

View File

@ -0,0 +1,11 @@
TARGET = QtPrintSupport
include($$PWD/../pymod.pri)
SOURCES = \
QtPrintSupportMain.cc \
HEADERS += \
LIBS += -lklayout_QtPrintSupport

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtPrintSupport, "QtPrintSupport", "KLayout/Qt module 'QtPrintSupport'")

11
src/pymod/QtSql/QtSql.pro Normal file
View File

@ -0,0 +1,11 @@
TARGET = QtSql
include($$PWD/../pymod.pri)
SOURCES = \
QtSqlMain.cc \
HEADERS += \
LIBS += -lklayout_QtSql

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtSql, "QtSql", "KLayout/Qt module 'QtSql'")

11
src/pymod/QtSvg/QtSvg.pro Normal file
View File

@ -0,0 +1,11 @@
TARGET = QtSvg
include($$PWD/../pymod.pri)
SOURCES = \
QtSvgMain.cc \
HEADERS += \
LIBS += -lklayout_QtSvg

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtSvg, "QtSvg", "KLayout/Qt module 'QtSvg'")

View File

@ -0,0 +1,11 @@
TARGET = QtWidgets
include($$PWD/../pymod.pri)
SOURCES = \
QtWidgetsMain.cc \
HEADERS += \
LIBS += -lklayout_QtWidgets

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtWidgets, "QtWidgets", "KLayout/Qt module 'QtWidgets'")

11
src/pymod/QtXml/QtXml.pro Normal file
View File

@ -0,0 +1,11 @@
TARGET = QtXml
include($$PWD/../pymod.pri)
SOURCES = \
QtXmlMain.cc \
HEADERS += \
LIBS += -lklayout_QtXml

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtXml, "QtXml", "KLayout/Qt module 'QtXml'")

View File

@ -0,0 +1,11 @@
TARGET = QtXmlPatterns
include($$PWD/../pymod.pri)
SOURCES = \
QtXmlPatternsMain.cc \
HEADERS += \
LIBS += -lklayout_QtXmlPatterns

View File

@ -0,0 +1,25 @@
/*
KLayout Layout Viewer
Copyright (C) 2006-2018 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"
DEFINE_PYMOD(QtXmlPatterns, "QtXmlPatterns", "KLayout/Qt module 'QtXmlPatterns'")

View File

@ -1,21 +1,12 @@
LIBDIR = $$OUT_PWD/../..
DESTDIR = $$LIBDIR/pymod
TARGET = db
include($$PWD/../../lib.pri)
include($$PWD/../pymod.pri)
SOURCES = \
dbMain.cc \
HEADERS += \
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_pya
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
LIBS += -lklayout_db

View File

@ -1,21 +1,11 @@
LIBDIR = $$OUT_PWD/../..
DESTDIR = $$LIBDIR/pymod
TARGET = lay
include($$PWD/../../lib.pri)
include($$PWD/../pymod.pri)
SOURCES = \
layMain.cc \
HEADERS += \
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_db -lklayout_gsi -lklayout_pya -lklayout_lay -lklayout_laybasic
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
LIBS += -lklayout_lay

30
src/pymod/pymod.pri Normal file
View File

@ -0,0 +1,30 @@
DESTDIR = $$OUT_PWD/..
LIBDIR = $$OUT_PWD/../..
DESTDIR_PYMOD = $$LIBDIR/pykl
include($$PWD/../lib.pri)
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_gsi -lklayout_pya
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
# Only on Windows, DESTDIR_TARGET is usable. On this platform, a blank happens to appear between
# $(DESTDIR) and $(TARGET)
win32 {
QMAKE_POST_LINK += $(MKDIR) $$DESTDIR_PYMOD && $(COPY) $(DESTDIR_TARGET) $$DESTDIR_PYMOD/$${TARGET}.dll
# to avoid the major version being appended to the dll name - in this case -lxyz won't link it again
# because the library is called xyx0.dll.
CONFIG += skip_target_version_ext
} else {
QMAKE_POST_LINK += $(MKDIR) $$DESTDIR_PYMOD && $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR_PYMOD/$${TARGET}.so
}

View File

@ -4,6 +4,31 @@ SUBDIRS = \
db \
tl \
lay \
QtGui \
QtCore \
equals(HAVE_QT5, "1") {
SUBDIRS += \
QtCore \
QtGui \
QtNetwork \
QtSql \
QtWidgets \
QtDesigner \
QtMultimedia \
QtPrintSupport \
QtSvg \
QtXmlPatterns \
QtXml
} else {
SUBDIRS += \
QtCore \
QtGui \
QtXml \
QtSql \
QtNetwork \
QtDesigner
}

View File

@ -1,21 +1,10 @@
LIBDIR = $$OUT_PWD/../..
DESTDIR = $$LIBDIR/pymod
TARGET = tl
include($$PWD/../../lib.pri)
include($$PWD/../pymod.pri)
SOURCES = \
tlMain.cc \
HEADERS += \
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_gsi -lklayout_pya
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers