X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2FCMakeLists.txt;h=e7d72644681d2bdb5b721f5ebf4754914955817d;hp=46835e50c8fcc4e190995a9eff800c0bd4feebd7;hb=ed5b2ff32158ae72c011eb1228f373cec05cbfeb;hpb=5b43f2776fa53bfe15a5b3b4398dfe3e931d5802 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 46835e50..e7d72644 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -1,6 +1,7 @@ -# Builds the common module +quassel_add_module(Common EXPORT) -set(SOURCES +target_sources(${TARGET} PRIVATE + abstractsignalwatcher.h aliasmanager.cpp authhandler.cpp backlogmanager.cpp @@ -9,11 +10,15 @@ set(SOURCES buffersyncer.cpp bufferviewconfig.cpp bufferviewmanager.cpp - cliparser.cpp compressor.cpp + coreinfo.cpp ctcpevent.cpp + dccconfig.cpp event.cpp eventmanager.cpp + expressionmatch.cpp + funchelpers.h + highlightrulemanager.cpp identity.cpp ignorelistmanager.cpp internalpeer.cpp @@ -22,54 +27,70 @@ set(SOURCES irclisthelper.cpp ircuser.cpp logger.cpp + logmessage.cpp message.cpp messageevent.cpp network.cpp networkconfig.cpp networkevent.cpp + nickhighlightmatcher.cpp peer.cpp peerfactory.cpp + presetnetworks.cpp quassel.cpp remotepeer.cpp settings.cpp signalproxy.cpp + singleton.h syncableobject.cpp transfer.cpp transfermanager.cpp + types.cpp util.cpp + serializers/serializers.cpp + protocols/datastream/datastreampeer.cpp protocols/legacy/legacypeer.cpp # needed for automoc - coreinfo.h + irccap.h + protocol.h ) +# Needed for finding the generated version.h +target_include_directories(${TARGET} PRIVATE ${CMAKE_BINARY_DIR}) -if (HAVE_QCA2) - set(SOURCES ${SOURCES} keyevent.cpp) -endif(HAVE_QCA2) - -if(NOT HAVE_ZLIB) - set(SOURCES ${SOURCES} ../../3rdparty/miniz/miniz.c) -endif(NOT HAVE_ZLIB) +target_link_libraries(${TARGET} PUBLIC + ${CMAKE_DL_LIBS} + Qt5::Core + Qt5::Network + ZLIB::ZLIB +) -if(APPLE) - set(SOURCES ${SOURCES} mac_utils.cpp) -endif(APPLE) +if (EMBED_DATA) + set_property(SOURCE quassel.cpp APPEND PROPERTY COMPILE_DEFINITIONS EMBED_DATA) +endif() -if(CMAKE_HOST_WIN32) - set(SOURCES ${SOURCES} logbacktrace_win.cpp) -endif(CMAKE_HOST_WIN32) -if(CMAKE_HOST_UNIX) - set(SOURCES ${SOURCES} logbacktrace_unix.cpp) -endif(CMAKE_HOST_UNIX) +if (HAVE_SYSLOG) + target_compile_definitions(${TARGET} PRIVATE -DHAVE_SYSLOG) +endif() -add_library(mod_common STATIC ${SOURCES}) -qt_use_modules(mod_common Core Network) +if (WIN32) + target_sources(${TARGET} PRIVATE logbacktrace_win.cpp windowssignalwatcher.cpp) +else() + if (Backtrace_FOUND) + configure_file(backtrace_config.h.in backtrace_config.h) + 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(${TARGET} PRIVATE logbacktrace_unix.cpp posixsignalwatcher.cpp) +endif() -if(APPLE) - target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") -endif(APPLE) +if (APPLE) + 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}) +target_link_if_exists(${TARGET} PUBLIC Quassel::Resource::I18n)