X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2FCMakeLists.txt;h=622193063801de55fabab38b0e61e796725a25cf;hp=7e67d02ff47976fff6a80e9134493d3c9823d940;hb=e56629542168c203cac8504085fc96c7f7b73d90;hpb=35b7f86e8ce903cf49e2db1cd0503a3142f76278 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7e67d02f..62219306 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -2,77 +2,79 @@ add_subdirectory(common) include_directories(BEFORE common) -if(WANT_CORE OR WANT_MONO) +if(BUILD_CORE) add_subdirectory(core) include_directories(BEFORE core) -endif(WANT_CORE OR WANT_MONO) -if(WANT_QTCLIENT OR WANT_MONO) +endif(BUILD_CORE) +if(BUILD_GUI) add_subdirectory(client) add_subdirectory(uisupport) add_subdirectory(qtui) include_directories(BEFORE client) include_directories(BEFORE uisupport) include_directories(BEFORE qtui) -# if(HAVE_KDE) -# add_subdirectory(kdeui) -# include_directories(kdeui) -# set(LINK_KDE mod_kdeui) -# endif(HAVE_KDE) if(STATIC) link_directories(${QT_PLUGINS_DIR}/imageformats) - set(CLIENT_LIBS qjpeg qgif) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} qjpeg qgif) endif(STATIC) - -endif(WANT_QTCLIENT OR WANT_MONO) +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) -qt4_add_resources(CLIENT_DEPS ${CLIENT_RCS}) -qt4_add_resources(CORE_DEPS ${CORE_RCS}) -qt4_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 KAboutData +if (WITH_KF5) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} KF5::CoreAddons) +endif() -if(INDICATEQT_FOUND) - link_directories(${INDICATEQT_LIBRARY_DIRS}) -endif(INDICATEQT_FOUND) +# Needed for showing the cli option if appropriate +if (HAVE_SYSLOG) + add_definitions(-DHAVE_SYSLOG) +endif() if(WANT_CORE) - setup_qt4_variables(NETWORK SCRIPT SQL) - add_executable(quasselcore common/main.cpp ${COMMON_DEPS} ${CORE_DEPS}) - add_dependencies(quasselcore po genversion_run) + 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 "-DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_CORE" + COMPILE_FLAGS "-DBUILD_CORE" OUTPUT_NAME ../quasselcore) - target_link_libraries(quasselcore mod_core mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) - install(TARGETS quasselcore RUNTIME DESTINATION ${BIN_INSTALL_DIR}) + target_link_libraries(quasselcore mod_core mod_common ${COMMON_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${QT_QTMAIN_LIBRARY}) + install(TARGETS quasselcore RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif(WANT_CORE) +if (KDE4_FOUND) + include_directories(${KDE4_INCLUDES}) +endif() + if(WANT_QTCLIENT) - setup_qt4_variables(${LINK_DBUS} GUI NETWORK ${LINK_WEBKIT}) - add_executable(quasselclient WIN32 common/main.cpp ${COMMON_DEPS} ${CLIENT_DEPS}) - add_dependencies(quasselclient po genversion_run) + 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 "-DQT_GUI_LIB -DQT_NETWORK_LIB -DBUILD_QTUI" + COMPILE_FLAGS "-DBUILD_QTUI" OUTPUT_NAME ../quasselclient) - target_link_libraries(quasselclient ${LINK_KDE} mod_qtui mod_uisupport mod_client mod_common ${CLIENT_LIBS} - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_KDE_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS} ${INDICATEQT_LIBRARIES}) - install(TARGETS quasselclient RUNTIME DESTINATION ${BIN_INSTALL_DIR}) + 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 ${CMAKE_INSTALL_BINDIR}) endif(WANT_QTCLIENT) if(WANT_MONO) - setup_qt4_variables(${LINK_DBUS} GUI NETWORK SCRIPT SQL ${LINK_WEBKIT}) - qt4_wrap_cpp(MOC qtui/monoapplication.h) - add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${MOC} ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS}) - add_dependencies(quassel po genversion_run) + 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 "-DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DBUILD_MONO" + COMPILE_FLAGS "-DBUILD_MONO" OUTPUT_NAME ../quassel) - target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common ${CLIENT_LIBS} - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_KDE_LIBRARIES} ${QUASSEL_SSL_LIBRARIES} ${PHONON_LIBS} ${INDICATEQT_LIBRARIES}) - install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR}) + 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 ${CMAKE_INSTALL_BINDIR}) endif(WANT_MONO) # Build bundles for MacOSX @@ -88,5 +90,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)