X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2FCMakeLists.txt;h=417e5ff3fa2dc5374737adb996b6e8a7c3cfdef3;hp=1b77dafbde72301674f175db9ea0056adfa5c101;hb=53e50ab66a5b3fa00282545ebc22ce3433ecf42b;hpb=8b07343ab53d37b5340a56bde2d71ff2a3afb14a diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 1b77dafb..417e5ff3 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -1,6 +1,6 @@ -# Builds the common module +quassel_add_module(Common EXPORT) -set(SOURCES +target_sources(${TARGET} PRIVATE abstractsignalwatcher.h aliasmanager.cpp authhandler.cpp @@ -17,7 +17,7 @@ set(SOURCES event.cpp eventmanager.cpp expressionmatch.cpp - # expressionmatchtests.cpp + funchelpers.h highlightrulemanager.cpp identity.cpp ignorelistmanager.cpp @@ -25,9 +25,11 @@ set(SOURCES ircchannel.cpp ircevent.cpp irclisthelper.cpp + ircdecoder.cpp + ircencoder.cpp + irctag.cpp ircuser.cpp logger.cpp - logmessage.cpp message.cpp messageevent.cpp network.cpp @@ -58,37 +60,40 @@ set(SOURCES protocol.h ) -if (HAVE_SYSLOG) - add_definitions(-DHAVE_SYSLOG) -endif() +# Needed for finding the generated version.h +target_include_directories(${TARGET} PRIVATE ${CMAKE_BINARY_DIR}) -if (APPLE) - set(SOURCES ${SOURCES} mac_utils.cpp) -endif() +target_link_libraries(${TARGET} PUBLIC + ${CMAKE_DL_LIBS} + Boost::boost + Qt5::Core + Qt5::Network + ZLIB::ZLIB +) -qt5_add_resources(SOURCES ${COMMON_RCS}) +if (EMBED_DATA) + set_property(SOURCE quassel.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA) +endif() -add_library(mod_common STATIC ${SOURCES}) -qt5_use_modules(mod_common Core Network) +if (HAVE_SYSLOG) + target_compile_definitions(${TARGET} PRIVATE -DHAVE_SYSLOG) +endif() if (WIN32) - target_sources(mod_common PRIVATE logbacktrace_win.cpp windowssignalwatcher.cpp) + target_sources(${TARGET} PRIVATE logbacktrace_win.cpp windowssignalwatcher.cpp) else() if (Backtrace_FOUND) configure_file(backtrace_config.h.in backtrace_config.h) - target_compile_definitions(mod_common PRIVATE -DHAVE_BACKTRACE) - target_include_directories(mod_common PRIVATE ${Backtrace_INCLUDE_DIRS}) - target_link_libraries(mod_common PRIVATE ${Backtrace_LIBRARIES}) + target_include_directories(${TARGET} PRIVATE ${Backtrace_INCLUDE_DIRS}) + target_link_libraries(${TARGET} PRIVATE ${Backtrace_LIBRARIES}) + set_property(SOURCE logbacktrace_unix.cpp posixsignalwatcher.cpp APPEND PROPERTY COMPILE_DEFINITIONS HAVE_BACKTRACE) endif() - target_sources(mod_common PRIVATE logbacktrace_unix.cpp posixsignalwatcher.cpp) + target_sources(${TARGET} PRIVATE logbacktrace_unix.cpp posixsignalwatcher.cpp) endif() if (APPLE) - target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") + target_sources(${TARGET} PRIVATE mac_utils.cpp) + target_link_libraries(${TARGET} PUBLIC "-framework CoreServices" "-framework CoreFoundation") endif() -target_link_libraries(mod_common ${CMAKE_DL_LIBS} ZLIB::ZLIB) - -# This is needed so translations are generated before trying to build the qrc. -# Should probably find a nicer solution with proper dependencies between the involved files, though... -add_dependencies(mod_common po) +target_link_if_exists(${TARGET} PUBLIC Quassel::Resource::I18n)