Commit f9fa02f2 authored by Volker Krause's avatar Volker Krause Committed by Torsten Rahn
Browse files

Integrate static plugins into more generation tools

Those are only needed once on initial setup and could be used offline, but
with this direct execution on the production system is also possible.
parent 8a8ecfc9
......@@ -35,6 +35,9 @@ target_link_libraries(${TARGET} marblewidget Qt5::Sql)
add_executable(marble-vectorosm-tilecreator vectorosm-tilecreator.cpp)
target_link_libraries(marble-vectorosm-tilecreator ${TARGET})
if (STATIC_BUILD)
target_link_libraries(marble-vectorosm-tilecreator OsmPlugin ShpPlugin)
endif()
add_executable(marble-vectorosm-cachetiles vectorosm-cachetiles.cpp)
target_link_libraries(marble-vectorosm-cachetiles ${TARGET})
......@@ -43,6 +46,9 @@ add_executable(marble-vectorosm-process-land-polygons
vectorosm-process-land-polygons.cpp
)
target_link_libraries(marble-vectorosm-process-land-polygons vectorosm-toolchain)
if (STATIC_BUILD)
target_link_libraries(marble-vectorosm-process-land-polygons OsmPlugin ShpPlugin)
endif()
add_executable(marble-vectorosm-tirex-backend
vectorosm-tirex-backend.cpp
......
......@@ -19,3 +19,4 @@ make -j 4
mkdir -p /output/usr/bin
cp tools/vectorosm-tilecreator/marble-vectorosm-tirex-backend /output/usr/bin/
cp tools/vectorosm-tilecreator/marble-vectorosm-process-land-polygons /output/usr/bin/
cp tools/vectorosm-tilecreator/marble-vectorosm-tilecreator /output/usr/bin/
......@@ -7,8 +7,12 @@
#include "TileDirectory.h"
#include "GeoDataLatLonAltBox.h"
#include "GeoDataDocumentWriter.h"
#include "MarbleModel.h"
#include "ParsingRunnerManager.h"
#ifdef STATIC_BUILD
#include "src/plugins/runner/osm/translators/O5mWriter.h"
#endif
#include <QCoreApplication>
#include <QCommandLineParser>
......@@ -16,6 +20,12 @@
#include <QDir>
#include <QFileInfo>
#ifdef STATIC_BUILD
#include <QtPlugin>
Q_IMPORT_PLUGIN(OsmPlugin)
Q_IMPORT_PLUGIN(ShpPlugin)
#endif
using namespace Marble;
int main(int argc, char **argv)
......@@ -33,6 +43,11 @@ int main(int argc, char **argv)
});
parser.process(app);
// work around MARBLE_ADD_WRITER not working for static builds
#ifdef STATIC_BUILD
GeoDataDocumentWriter::registerWriter(new O5mWriter, QStringLiteral("o5m"));
#endif
MarbleModel model;
ParsingRunnerManager manager(model.pluginManager());
QString const cacheDirectory = parser.value("cache-directory");
......
......@@ -18,6 +18,9 @@
#include "GeoDataLatLonAltBox.h"
#include "TileId.h"
#include "MarbleDirs.h"
#ifdef STATIC_BUILD
#include "src/plugins/runner/osm/translators/O5mWriter.h"
#endif
#include <QApplication>
#include <QCommandLineParser>
......@@ -41,6 +44,12 @@
#include "MbTileWriter.h"
#include "SpellChecker.h"
#ifdef STATIC_BUILD
#include <QtPlugin>
Q_IMPORT_PLUGIN(OsmPlugin)
Q_IMPORT_PLUGIN(ShpPlugin)
#endif
#include <iostream>
using namespace Marble;
......@@ -173,6 +182,11 @@ int main(int argc, char *argv[])
return 1;
}
// work around MARBLE_ADD_WRITER not working for static builds
#ifdef STATIC_BUILD
GeoDataDocumentWriter::registerWriter(new O5mWriter, QStringLiteral("o5m"));
#endif
bool const overwriteTiles = parser.value("conflict-resolution") == "overwrite";
bool const mergeTiles = parser.value("conflict-resolution") == "merge";
bool const writeBoundaries = mergeTiles || parser.isSet("boundaries");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment