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