X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2FCMakeLists.txt;h=8beb17c0f320aa9a1abe28bff1267b942775f59b;hp=c4f652aff5467a8e0d11971eea11b0a865ab1053;hb=0216d4a650c02155b5bcd517567209f674d8a120;hpb=3ff2a8a6d3750fc5b68af6faeece5b60e7a25f20 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c4f652af..8beb17c0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,77 +1,89 @@ # Builds the three main targets add_subdirectory(common) -include_directories(common) -if(WANT_CORE OR WANT_MONO) +include_directories(BEFORE common) +if(BUILD_CORE) add_subdirectory(core) - include_directories(core) -endif(WANT_CORE OR WANT_MONO) -if(WANT_QTCLIENT OR WANT_MONO) + include_directories(BEFORE core) +endif() +if(BUILD_GUI) add_subdirectory(client) add_subdirectory(uisupport) add_subdirectory(qtui) - include_directories(client) - include_directories(uisupport) - include_directories(qtui) -endif(WANT_QTCLIENT OR WANT_MONO) + include_directories(BEFORE client) + include_directories(BEFORE uisupport) + include_directories(BEFORE qtui) -# We always add stuff in :/pics -qt4_add_resources(CLIENT_DEPS ../pics/pics.qrc) + if(STATIC) + link_directories(${QT_PLUGINS_DIR}/imageformats) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} qjpeg qgif) + endif() +endif() -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") +include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) # for version.gen -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") +# We need to initialize the appropriate resources, so let's give our main.cpp some hints +if (EMBED_DATA) + add_definitions(-DEMBED_DATA) +endif() + +# For KAboutData +if (WITH_KF5) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} KF5::CoreAddons) +endif() + +# 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_executable(quasselcore common/main.cpp ${CORE_DEPS} ${COMMON_DEPS}) + qt5_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") - target_link_libraries(quasselcore mod_core mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) - install(TARGETS quasselcore RUNTIME DESTINATION ${BIN_INSTALL_DIR}) -endif(WANT_CORE) + COMPILE_FLAGS "-DBUILD_CORE" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_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() if(WANT_QTCLIENT) - setup_qt4_variables(${LINK_DBUS} GUI NETWORK WEBKIT) - add_executable(quasselclient WIN32 common/main.cpp ${COMMON_DEPS} ${CLIENT_DEPS}) - add_dependencies(quasselclient icons) + add_executable(quasselclient WIN32 common/main.cpp ${CLIENT_DEPS} ${COMMON_DEPS}) + qt5_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") - target_link_libraries(quasselclient mod_qtui mod_uisupport mod_client mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) - install(TARGETS quasselclient RUNTIME DESTINATION ${BIN_INSTALL_DIR}) -endif(WANT_QTCLIENT) + COMPILE_FLAGS "-DBUILD_QTUI" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_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() if(WANT_MONO) - setup_qt4_variables(${LINK_DBUS} GUI NETWORK SCRIPT SQL WEBKIT) - add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${COMMON_DEPS} ${CLIENT_DEPS} ${CORE_DEPS}) - add_dependencies(quassel icons) + add_executable(quassel WIN32 common/main.cpp qtui/monoapplication.cpp ${CLIENT_DEPS} ${CORE_DEPS} ${COMMON_DEPS}) + qt5_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") - target_link_libraries(quassel mod_qtui mod_uisupport mod_client mod_core mod_common - ${QUASSEL_QT_LIBRARIES} ${QUASSEL_SSL_LIBRARIES}) - install(TARGETS quassel RUNTIME DESTINATION ${BIN_INSTALL_DIR}) -endif(WANT_MONO) + COMPILE_FLAGS "-DBUILD_MONO" + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_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() # Build bundles for MacOSX if(APPLE) add_custom_command(TARGET quasselclient POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makebundle.py - ${CMAKE_SOURCE_DIR} "Quassel Client" quasselclient) + ${CMAKE_SOURCE_DIR} "Quassel Client" ../quasselclient) add_custom_command(TARGET quassel POST_BUILD COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makebundle.py - ${CMAKE_SOURCE_DIR} "Quassel" quassel) + ${CMAKE_SOURCE_DIR} "Quassel" ../quassel) if(DEPLOY) add_custom_command(TARGET quasselclient POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Client) + COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Client .. qsvgicon) add_custom_command(TARGET quasselcore POST_BUILD - COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Core) - endif(DEPLOY) -endif(APPLE) + COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Core ..) + add_custom_command(TARGET quassel POST_BUILD + COMMAND ${CMAKE_SOURCE_DIR}/scripts/build/macosx_makePackage.sh Mono .. qsvgicon) + endif() +endif()