WORKING_DIRECTORY ${basedir}
)
- # Generate library target that can be referenced elsewhere
- quassel_add_module(Resource::${_name})
+ # Generate library target that can be referenced elsewhere. Force static, because
+ # we can't easily export symbols from the generated sources.
+ quassel_add_module(Resource::${_name} STATIC)
target_sources(${TARGET} PRIVATE ${qrc_srcpath})
set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF)
# Always embed a hicolor fallback containing the most important (e.g. tray) icons.
# The .qrc contains aliases, so it's best to keep this manually written rather than autogenerated.
- quassel_add_module(Resource::HicolorIcons)
+ quassel_add_module(Resource::HicolorIcons STATIC)
target_sources(${TARGET} PRIVATE hicolor_icons.qrc)
set_target_properties(${TARGET} PROPERTIES AUTOMOC OFF AUTOUIC OFF)
Quassel::Common
)
+if (EMBED_DATA)
+ set_property(SOURCE client.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA)
+endif()
+
target_link_if_exists(${TARGET} PUBLIC Quassel::Resource::Data)
_coreConnection(new CoreConnection(this)),
_connected(false)
{
+#ifdef EMBED_DATA
+ Q_INIT_RESOURCE(data);
+#endif
+
//connect(mainUi(), SIGNAL(connectToCore(const QVariantMap &)), this, SLOT(connectToCore(const QVariantMap &)));
connect(mainUi(), SIGNAL(disconnectFromCore()), this, SLOT(disconnectFromCore()));
connect(this, SIGNAL(connected()), mainUi(), SLOT(connectedToCore()));
ZLIB::ZLIB
)
+if (EMBED_DATA)
+ set_property(SOURCE quassel.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA)
+endif()
+
if (HAVE_SYSLOG)
target_compile_definitions(${TARGET} PRIVATE -DHAVE_SYSLOG)
endif()
: Singleton<Quassel>{this}
, _logger{new Logger{this}}
{
+#ifdef EMBED_DATA
+ Q_INIT_RESOURCE(i18n);
+#endif
}
Core::Core()
: Singleton<Core>{this}
{
+ Q_INIT_RESOURCE(sql);
+
// Parent all QObject-derived attributes, so when the Core instance gets moved into another
// thread, they get moved with it
_server.setParent(this);
install(TARGETS ${_target} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
endfunction()
-# We need to initialize the appropriate resources, so let's give our main.cpp some hints
-if (EMBED_DATA)
- set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA)
-endif()
-
if (HAVE_UMASK)
set_property(SOURCE main.cpp APPEND PROPERTY COMPILE_DEFINITIONS HAVE_UMASK)
endif()
int main(int argc, char **argv)
{
- // We need to explicitly initialize the required resources when linking statically
-#ifndef BUILD_QTUI
- Q_INIT_RESOURCE(sql);
-#endif
-#ifndef BUILD_CORE
- Q_INIT_RESOURCE(pics);
- Q_INIT_RESOURCE(hicolor_icons);
-#endif
-
-#ifdef EMBED_DATA
- Q_INIT_RESOURCE(i18n);
-# ifndef BUILD_CORE
- Q_INIT_RESOURCE(data);
- Q_INIT_RESOURCE(icons);
-# ifdef WITH_BUNDLED_ICONS
- Q_INIT_RESOURCE(iconthemes);
-# endif
-# endif
-#endif
-
// Set umask so files are created with restricted permissions
#ifdef HAVE_UMASK
umask(S_IRWXG | S_IRWXO);
Quassel::Common
)
+if (EMBED_DATA)
+ set_property(SOURCE graphicalui.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA)
+endif()
+
if (WITH_KF5)
target_link_libraries(${TARGET}
PUBLIC
GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent), Singleton<GraphicalUi>(this)
{
+ Q_INIT_RESOURCE(pics);
+ Q_INIT_RESOURCE(hicolor_icons);
+#ifdef EMBED_DATA
+ Q_INIT_RESOURCE(icons);
+ Q_INIT_RESOURCE(iconthemes);
+#endif
+
#ifdef Q_OS_WIN
_dwTickCount = 0;
#endif