Try to fix icons not being found on some systems
authorManuel Nickschas <sputnick@quassel-irc.org>
Sun, 28 Sep 2008 18:43:35 +0000 (20:43 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sun, 28 Sep 2008 18:43:35 +0000 (20:43 +0200)
src/CMakeLists.txt
src/qtui/qtuiapplication.cpp

index bf3a92f..d165e62 100644 (file)
@@ -1,5 +1,23 @@
 # Builds the three main targets
 
+# Define resources for icons and pics, if needed
+# We always add stuff in :/pics
+qt4_add_resources(CLIENT_DEPS ../pics/pics.qrc)
+
+if(QUASSEL_ICONS MATCHES "Builtin")
+  set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_hicolor.cxx)
+  set_source_files_properties(../icons/qrc_hicolor.cxx PROPERTIES GENERATED true)
+  add_definitions(-DQUASSEL_ICONS_BUILTIN)
+endif(QUASSEL_ICONS MATCHES "Builtin")
+
+if(OXYGEN_ICONS MATCHES "Builtin")
+  set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_oxygen.cxx)
+  set_source_files_properties(../icons/qrc_oxygen.cxx PROPERTIES GENERATED true)
+  add_definitions(-DOXYGEN_ICONS_BUILTIN)
+endif(OXYGEN_ICONS MATCHES "Builtin")
+
+# Now it's time to build the modules...
+
 add_subdirectory(common)
 include_directories(common)
 if(WANT_CORE OR WANT_MONO)
@@ -15,18 +33,7 @@ if(WANT_QTCLIENT OR WANT_MONO)
   include_directories(qtui)
 endif(WANT_QTCLIENT OR WANT_MONO)
 
-# We always add stuff in :/pics
-qt4_add_resources(CLIENT_DEPS ../pics/pics.qrc)
-
-if(QUASSEL_ICONS MATCHES "Builtin")
-  set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_hicolor.cxx)
-  set_source_files_properties(../icons/qrc_hicolor.cxx PROPERTIES GENERATED true)
-endif(QUASSEL_ICONS MATCHES "Builtin")
-
-if(OXYGEN_ICONS MATCHES "Builtin")
-  set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_oxygen.cxx)
-  set_source_files_properties(../icons/qrc_oxygen.cxx PROPERTIES GENERATED true)
-endif(OXYGEN_ICONS MATCHES "Builtin")
+# ... and finally the executables
 
 if(WANT_CORE)
   setup_qt4_variables(NETWORK SCRIPT SQL)
index 6ae09c9..0049bff 100644 (file)
 #include "sessionsettings.h"
 
 QtUiApplication::QtUiApplication(int &argc, char **argv) : QApplication(argc, argv), Quassel() {
+  Q_INIT_RESOURCE(pics);
+# ifdef QUASSEL_ICONS_BUILTIN
+  Q_INIT_RESOURCE(hicolor);
+# endif
+# ifdef OXYGEN_ICONS_BUILTIN
+  Q_INIT_RESOURCE(oxygen);
+# endif
+
   setRunMode(Quassel::ClientOnly);
 
   // put client-only arguments here