Try to fix icons not being found on some systems
[quassel.git] / src / CMakeLists.txt
1 # Builds the three main targets
2
3 # Define resources for icons and pics, if needed
4 # We always add stuff in :/pics
5 qt4_add_resources(CLIENT_DEPS ../pics/pics.qrc)
6
7 if(QUASSEL_ICONS MATCHES "Builtin")
8   set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_hicolor.cxx)
9   set_source_files_properties(../icons/qrc_hicolor.cxx PROPERTIES GENERATED true)
10   add_definitions(-DQUASSEL_ICONS_BUILTIN)
11 endif(QUASSEL_ICONS MATCHES "Builtin")
12
13 if(OXYGEN_ICONS MATCHES "Builtin")
14   set(CLIENT_DEPS ${CLIENT_DEPS} ../icons/qrc_oxygen.cxx)
15   set_source_files_properties(../icons/qrc_oxygen.cxx PROPERTIES GENERATED true)
16   add_definitions(-DOXYGEN_ICONS_BUILTIN)
17 endif(OXYGEN_ICONS MATCHES "Builtin")
18
19 # Now it's time to build the modules...
20
21 add_subdirectory(common)
22 include_directories(common)
23 if(WANT_CORE OR WANT_MONO)
24   add_subdirectory(core)
25   include_directories(core)
26 endif(WANT_CORE OR WANT_MONO)
27 if(WANT_QTCLIENT OR WANT_MONO)
28   add_subdirectory(client)
29   add_subdirectory(uisupport)
30   add_subdirectory(qtui)
31   include_directories(client)
32   include_directories(uisupport)
33   include_directories(qtui)
34 endif(WANT_QTCLIENT OR WANT_MONO)
35
36 # ... and finally the executables
37
38 if(WANT_CORE)
39   setup_qt4_variables(NETWORK SCRIPT SQL)
40   add_executable(quasselcore common/main.cpp ${COMMON_DEPS} ${CORE_DEPS})
41   set_target_properties(quasselcore PROPERTIES
42                                     COMPILE_FLAGS "-DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_CORE"
43                                     OUTPUT_NAME ../quasselcore)
44   target_link_libraries(quasselcore mod_core mod_common
45                                     ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES})
46   install(TARGETS quasselcore RUNTIME DESTINATION ${BIN_INSTALL_DIR})
47 endif(WANT_CORE)
48
49 if(WANT_QTCLIENT)
50   setup_qt4_variables(${LINK_DBUS} GUI NETWORK ${LINK_WEBKIT})
51   add_executable(quasselclient WIN32 common/main.cpp ${COMMON_DEPS} ${CLIENT_DEPS})
52   add_dependencies(quasselclient icons)
53   set_target_properties(quasselclient PROPERTIES
54                                       COMPILE_FLAGS "-DQT_GUI_LIB -DQT_NETWORK_LIB -DBUILD_QTUI"
55                                       OUTPUT_NAME ../quasselclient)
56   target_link_libraries(quasselclient mod_qtui mod_uisupport mod_client mod_common
57                                       ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES})
58   install(TARGETS quasselclient RUNTIME DESTINATION ${BIN_INSTALL_DIR})
59 endif(WANT_QTCLIENT)
60
61 if(WANT_MONO)
62   setup_qt4_variables(${LINK_DBUS} GUI NETWORK SCRIPT SQL ${LINK_WEBKIT})
63   add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS})
64   add_dependencies(quassel icons)
65   set_target_properties(quassel PROPERTIES
66                                 COMPILE_FLAGS "-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_MONO"
67                                 OUTPUT_NAME ../quassel)
68   target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common
69                                 ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES})
70   install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR})
71 endif(WANT_MONO)
72
73 # Build bundles for MacOSX
74 if(APPLE)
75   add_custom_command(TARGET quasselclient POST_BUILD
76                      COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makebundle.py
77                              ${CMAKE_SOURCE_DIR} "Quassel Client" ../quasselclient)
78   add_custom_command(TARGET quassel POST_BUILD
79                      COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makebundle.py
80                              ${CMAKE_SOURCE_DIR} "Quassel" ../quassel)
81   if(DEPLOY)
82     add_custom_command(TARGET quasselclient POST_BUILD
83                        COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Client ..)
84     add_custom_command(TARGET quasselcore POST_BUILD
85                        COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Core ..)
86   endif(DEPLOY)
87 endif(APPLE)