diff --git a/src/pymod/QtCore/QtCore.pro b/src/pymod/QtCore/QtCore.pro index 7d2ba4efc..80fc673b9 100644 --- a/src/pymod/QtCore/QtCore.pro +++ b/src/pymod/QtCore/QtCore.pro @@ -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 diff --git a/src/pymod/QtDesigner/QtDesigner.pro b/src/pymod/QtDesigner/QtDesigner.pro new file mode 100644 index 000000000..a8aaef5f2 --- /dev/null +++ b/src/pymod/QtDesigner/QtDesigner.pro @@ -0,0 +1,11 @@ + +TARGET = QtDesigner + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtDesignerMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtDesigner diff --git a/src/pymod/QtDesigner/QtDesignerMain.cc b/src/pymod/QtDesigner/QtDesignerMain.cc new file mode 100644 index 000000000..000fa722c --- /dev/null +++ b/src/pymod/QtDesigner/QtDesignerMain.cc @@ -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'") diff --git a/src/pymod/QtGui/QtGui.pro b/src/pymod/QtGui/QtGui.pro index 681523ceb..909a18b95 100644 --- a/src/pymod/QtGui/QtGui.pro +++ b/src/pymod/QtGui/QtGui.pro @@ -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 diff --git a/src/pymod/QtMultimedia/QtMultimedia.pro b/src/pymod/QtMultimedia/QtMultimedia.pro new file mode 100644 index 000000000..e0c6ec121 --- /dev/null +++ b/src/pymod/QtMultimedia/QtMultimedia.pro @@ -0,0 +1,11 @@ + +TARGET = QtMultimedia + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtMultimediaMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtMultimedia diff --git a/src/pymod/QtMultimedia/QtMultimediaMain.cc b/src/pymod/QtMultimedia/QtMultimediaMain.cc new file mode 100644 index 000000000..c8fc0c3f5 --- /dev/null +++ b/src/pymod/QtMultimedia/QtMultimediaMain.cc @@ -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'") diff --git a/src/pymod/QtNetwork/QtNetwork.pro b/src/pymod/QtNetwork/QtNetwork.pro new file mode 100644 index 000000000..e2014baff --- /dev/null +++ b/src/pymod/QtNetwork/QtNetwork.pro @@ -0,0 +1,11 @@ + +TARGET = QtNetwork + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtNetworkMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtNetwork diff --git a/src/pymod/QtNetwork/QtNetworkMain.cc b/src/pymod/QtNetwork/QtNetworkMain.cc new file mode 100644 index 000000000..fcc8c3f26 --- /dev/null +++ b/src/pymod/QtNetwork/QtNetworkMain.cc @@ -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'") diff --git a/src/pymod/QtPrintSupport/QtPrintSupport.pro b/src/pymod/QtPrintSupport/QtPrintSupport.pro new file mode 100644 index 000000000..e709d6592 --- /dev/null +++ b/src/pymod/QtPrintSupport/QtPrintSupport.pro @@ -0,0 +1,11 @@ + +TARGET = QtPrintSupport + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtPrintSupportMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtPrintSupport diff --git a/src/pymod/QtPrintSupport/QtPrintSupportMain.cc b/src/pymod/QtPrintSupport/QtPrintSupportMain.cc new file mode 100644 index 000000000..2bf8b0253 --- /dev/null +++ b/src/pymod/QtPrintSupport/QtPrintSupportMain.cc @@ -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'") diff --git a/src/pymod/QtSql/QtSql.pro b/src/pymod/QtSql/QtSql.pro new file mode 100644 index 000000000..ad61aac64 --- /dev/null +++ b/src/pymod/QtSql/QtSql.pro @@ -0,0 +1,11 @@ + +TARGET = QtSql + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtSqlMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtSql diff --git a/src/pymod/QtSql/QtSqlMain.cc b/src/pymod/QtSql/QtSqlMain.cc new file mode 100644 index 000000000..7bd362201 --- /dev/null +++ b/src/pymod/QtSql/QtSqlMain.cc @@ -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'") diff --git a/src/pymod/QtSvg/QtSvg.pro b/src/pymod/QtSvg/QtSvg.pro new file mode 100644 index 000000000..da0175177 --- /dev/null +++ b/src/pymod/QtSvg/QtSvg.pro @@ -0,0 +1,11 @@ + +TARGET = QtSvg + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtSvgMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtSvg diff --git a/src/pymod/QtSvg/QtSvgMain.cc b/src/pymod/QtSvg/QtSvgMain.cc new file mode 100644 index 000000000..39a670d0e --- /dev/null +++ b/src/pymod/QtSvg/QtSvgMain.cc @@ -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'") diff --git a/src/pymod/QtWidgets/QtWidgets.pro b/src/pymod/QtWidgets/QtWidgets.pro new file mode 100644 index 000000000..26f6170a9 --- /dev/null +++ b/src/pymod/QtWidgets/QtWidgets.pro @@ -0,0 +1,11 @@ + +TARGET = QtWidgets + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtWidgetsMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtWidgets diff --git a/src/pymod/QtWidgets/QtWidgetsMain.cc b/src/pymod/QtWidgets/QtWidgetsMain.cc new file mode 100644 index 000000000..37395d454 --- /dev/null +++ b/src/pymod/QtWidgets/QtWidgetsMain.cc @@ -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'") diff --git a/src/pymod/QtXml/QtXml.pro b/src/pymod/QtXml/QtXml.pro new file mode 100644 index 000000000..b4c626bda --- /dev/null +++ b/src/pymod/QtXml/QtXml.pro @@ -0,0 +1,11 @@ + +TARGET = QtXml + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtXmlMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtXml diff --git a/src/pymod/QtXml/QtXmlMain.cc b/src/pymod/QtXml/QtXmlMain.cc new file mode 100644 index 000000000..daf9bec5e --- /dev/null +++ b/src/pymod/QtXml/QtXmlMain.cc @@ -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'") diff --git a/src/pymod/QtXmlPatterns/QtXmlPatterns.pro b/src/pymod/QtXmlPatterns/QtXmlPatterns.pro new file mode 100644 index 000000000..72a6329a0 --- /dev/null +++ b/src/pymod/QtXmlPatterns/QtXmlPatterns.pro @@ -0,0 +1,11 @@ + +TARGET = QtXmlPatterns + +include($$PWD/../pymod.pri) + +SOURCES = \ + QtXmlPatternsMain.cc \ + +HEADERS += \ + +LIBS += -lklayout_QtXmlPatterns diff --git a/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc new file mode 100644 index 000000000..ce6c64e71 --- /dev/null +++ b/src/pymod/QtXmlPatterns/QtXmlPatternsMain.cc @@ -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'") diff --git a/src/pymod/db/db.pro b/src/pymod/db/db.pro index 3183483be..345123a4b 100644 --- a/src/pymod/db/db.pro +++ b/src/pymod/db/db.pro @@ -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 diff --git a/src/pymod/lay/lay.pro b/src/pymod/lay/lay.pro index 7173f42c9..4be33a91d 100644 --- a/src/pymod/lay/lay.pro +++ b/src/pymod/lay/lay.pro @@ -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 diff --git a/src/pymod/pymod.pri b/src/pymod/pymod.pri new file mode 100644 index 000000000..f558ce444 --- /dev/null +++ b/src/pymod/pymod.pri @@ -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 +} + diff --git a/src/pymod/pymod.pro b/src/pymod/pymod.pro index 28ab71b6b..dd371b5de 100644 --- a/src/pymod/pymod.pro +++ b/src/pymod/pymod.pro @@ -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 + +} diff --git a/src/pymod/tl/tl.pro b/src/pymod/tl/tl.pro index 1fa6dbbbc..30961c2b5 100644 --- a/src/pymod/tl/tl.pro +++ b/src/pymod/tl/tl.pro @@ -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 -