X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2FCMakeLists.txt;h=59facd848d464d8822ad181c3b0d336d1c6f5d3b;hp=ad964979e02f8d7fe32d855a795f0945a9c08f1e;hb=921e54680da16fcf2adb7a90506875aceb6633a4;hpb=5b43f2776fa53bfe15a5b3b4398dfe3e931d5802 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ad964979..59facd84 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -22,47 +22,53 @@ endif(BUILD_GUI) include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # for version.gen -# Add resources. Can't be done in other subdirs apparently. -# Note that these variables need to contain paths relative to src/ (this dir) -qt_add_resources(CLIENT_DEPS ${CLIENT_RCS}) -qt_add_resources(CORE_DEPS ${CORE_RCS}) -qt_add_resources(COMMON_DEPS ${COMMON_RCS}) +# We need to initialize the appropriate resources, so let's give our main.cpp some hints +if (EMBED_DATA) + add_definitions(-DEMBED_DATA) +endif() +if (WITH_OXYGEN) + add_definitions(-DWITH_OXYGEN) +endif() -# For Windows, Qt4 needs the QtMain module -if (WIN32 AND NOT WITH_QT5) - set(MAIN Main) +# Needed for showing the cli option if appropriate +if (HAVE_SYSLOG) + add_definitions(-DHAVE_SYSLOG) endif() if(WANT_CORE) - add_executable(quasselcore common/main.cpp ${COMMON_DEPS} ${CORE_DEPS}) - qt_use_modules(quasselcore Core Network ${CORE_QT_MODULES} ${MAIN}) + add_executable(quasselcore common/main.cpp ${CORE_DEPS} ${COMMON_DEPS}) + qt_use_modules(quasselcore Core Network ${CORE_QT_MODULES}) add_dependencies(quasselcore po) set_target_properties(quasselcore PROPERTIES COMPILE_FLAGS "-DBUILD_CORE" OUTPUT_NAME ../quasselcore) - target_link_libraries(quasselcore mod_core mod_common ${COMMON_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) + target_link_libraries(quasselcore mod_core mod_common ${COMMON_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY}) install(TARGETS quasselcore RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif(WANT_CORE) +if (KDE4_FOUND) + include_directories(${KDE4_INCLUDES}) +endif() + if(WANT_QTCLIENT) - add_executable(quasselclient WIN32 common/main.cpp ${COMMON_DEPS} ${CLIENT_DEPS}) - qt_use_modules(quasselclient Core Gui Network ${CLIENT_QT_MODULES} ${MAIN}) + add_executable(quasselclient WIN32 common/main.cpp ${CLIENT_DEPS} ${COMMON_DEPS}) + qt_use_modules(quasselclient Core Gui Network ${CLIENT_QT_MODULES}) add_dependencies(quasselclient po) set_target_properties(quasselclient PROPERTIES - COMPILE_FLAGS "-DBUILD_QTUI ${CLIENT_COMPILE_FLAGS}" + COMPILE_FLAGS "-DBUILD_QTUI" OUTPUT_NAME ../quasselclient) - target_link_libraries(quasselclient ${LINK_KDE} mod_qtui mod_uisupport mod_client mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) + target_link_libraries(quasselclient mod_qtui mod_uisupport mod_client mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY}) install(TARGETS quasselclient RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif(WANT_QTCLIENT) if(WANT_MONO) - add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS}) - qt_use_modules(quassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES} ${MAIN}) + add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS}) + qt_use_modules(quassel Core Gui Network ${CLIENT_QT_MODULES} ${CORE_QT_MODULES}) add_dependencies(quassel po) set_target_properties(quassel PROPERTIES - COMPILE_FLAGS "-DBUILD_MONO ${CLIENT_COMPILE_FLAGS}" + COMPILE_FLAGS "-DBUILD_MONO" OUTPUT_NAME ../quassel) - target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) + target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common ${COMMON_LIBRARIES} ${CLIENT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY}) install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR}) endif(WANT_MONO) @@ -79,5 +85,7 @@ if(APPLE) COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Client ..) add_custom_command(TARGET quasselcore POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Core ..) + add_custom_command(TARGET quasselcore POST_BUILD + COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Mono ..) endif(DEPLOY) endif(APPLE)