mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2025-03-16 02:42:39 +00:00
build: produce static libraries
This also adds the constructor to the plugin class, as it should now be called to register the qml types. Dynamic linking mostly has its problem on Sailfish OS, as it creates larger binaries and RPMs. Since this is the only application consuming it, I see no benefit in using it.
This commit is contained in:
parent
53f3e6aa1c
commit
0180aeaab1
|
@ -114,7 +114,7 @@ endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_library(JellyfinQt ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS} qmldir JellyfinQt.qmltypes)
|
add_library(JellyfinQt STATIC ${JellyfinQt_SOURCES} ${JellyfinQt_HEADERS} qmldir JellyfinQt.qmltypes)
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
if(${CMAKE_VERSION} VERSION_GREATER "3.16.0")
|
||||||
if(BUILD_PRECOMPILED_HEADERS)
|
if(BUILD_PRECOMPILED_HEADERS)
|
||||||
|
@ -164,6 +164,6 @@ add_custom_command(
|
||||||
|
|
||||||
|
|
||||||
set(QML_IMPORT_PATH $<TARGET_FILE_DIR:JellyfinQt> CACHE PATH "")
|
set(QML_IMPORT_PATH $<TARGET_FILE_DIR:JellyfinQt> CACHE PATH "")
|
||||||
install(FILES $<TARGET_FILE_DIR:JellyfinQt>/qmldir DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
# install(FILES $<TARGET_FILE_DIR:JellyfinQt>/qmldir DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
|
||||||
export(TARGETS JellyfinQt FILE JellyfinQtConfig.cmake)
|
export(TARGETS JellyfinQt FILE JellyfinQtConfig.cmake)
|
||||||
|
|
|
@ -28,6 +28,7 @@ class JellyfinPlugin : public QQmlExtensionPlugin {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
|
||||||
public:
|
public:
|
||||||
|
explicit JellyfinPlugin(QObject *parent = nullptr);
|
||||||
void registerTypes(const char *uri) override;
|
void registerTypes(const char *uri) override;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -48,6 +48,12 @@
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
|
|
||||||
|
JellyfinPlugin::JellyfinPlugin(QObject *parent)
|
||||||
|
: QQmlExtensionPlugin(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void JellyfinPlugin::registerTypes(const char *uri) {
|
void JellyfinPlugin::registerTypes(const char *uri) {
|
||||||
qmlRegisterType<ApiClient>(uri, 1, 0, "ApiClient");
|
qmlRegisterType<ApiClient>(uri, 1, 0, "ApiClient");
|
||||||
qmlRegisterType<ServerDiscoveryModel>(uri, 1, 0, "ServerDiscoveryModel");
|
qmlRegisterType<ServerDiscoveryModel>(uri, 1, 0, "ServerDiscoveryModel");
|
||||||
|
|
|
@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
#include <QQuickView>
|
#include <QQuickView>
|
||||||
#include <QQmlEngine>
|
#include <QQmlEngine>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <JellyfinQt/jellyfin.h>
|
||||||
|
|
||||||
#include <sailfishapp.h>
|
#include <sailfishapp.h>
|
||||||
|
|
||||||
|
@ -52,6 +53,9 @@ int main(int argc, char *argv[]) {
|
||||||
//: Application display name
|
//: Application display name
|
||||||
app->setApplicationDisplayName(QObject::tr("Sailfin"));
|
app->setApplicationDisplayName(QObject::tr("Sailfin"));
|
||||||
|
|
||||||
|
Jellyfin::JellyfinPlugin *plugin = new Jellyfin::JellyfinPlugin(app);
|
||||||
|
plugin->registerTypes("nl.netsoj.chris.Jellyfin");
|
||||||
|
|
||||||
QCommandLineParser cmdParser;
|
QCommandLineParser cmdParser;
|
||||||
cmdParser.addHelpOption();
|
cmdParser.addHelpOption();
|
||||||
cmdParser.addVersionOption();
|
cmdParser.addVersionOption();
|
||||||
|
|
Loading…
Reference in a new issue