From 1d3537dca504cb52ff0434471537a96ca4432007 Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Sat, 3 Jan 2015 01:19:10 +0100 Subject: [PATCH] Use link dependencies between Quassel modules Rather than expressing build dependencies between the Quassel modules through add_dependency, we should treat those as link dependencies instead. This has the added advantage that transitive deps work properly (including properties like include dirs). --- src/client/CMakeLists.txt | 4 ++-- src/common/CMakeLists.txt | 8 ++++---- src/core/CMakeLists.txt | 6 +----- src/qtui/CMakeLists.txt | 7 +------ src/uisupport/CMakeLists.txt | 7 ++++--- 5 files changed, 12 insertions(+), 20 deletions(-) diff --git a/src/client/CMakeLists.txt b/src/client/CMakeLists.txt index 3dd15044..4f0106c4 100644 --- a/src/client/CMakeLists.txt +++ b/src/client/CMakeLists.txt @@ -52,8 +52,8 @@ qt_add_resources(SOURCES ${CLIENT_RCS}) add_library(mod_client STATIC ${SOURCES}) qt_use_modules(mod_client Network Core Gui ${qt_modules}) +target_link_libraries(mod_client mod_common) + if (KDE4_FOUND) target_link_libraries(mod_client ${KDE4_SOLID_LIBS}) endif() - -add_dependencies(mod_client mod_common) diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 23e5601e..fa48020d 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -62,8 +62,8 @@ if (HAVE_SYSLOG) add_definitions(-DHAVE_SYSLOG) endif() -if(APPLE) - set(SOURCES ${SOURCES} mac_utils.cpp) +if (APPLE) + set(SOURCES ${SOURCES} mac_utils.cpp) endif(APPLE) if (WIN32) @@ -81,8 +81,8 @@ qt_add_resources(SOURCES ${COMMON_RCS}) add_library(mod_common STATIC ${SOURCES}) qt_use_modules(mod_common Core Network) -if(APPLE) - target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") +if (APPLE) + target_link_libraries(mod_common "-framework CoreServices" "-framework CoreFoundation") endif(APPLE) target_link_libraries(mod_common ${CMAKE_DL_LIBS} ${EXECINFO_LIBRARIES} ${ZLIB_LIBRARIES}) diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 6a0611af..a9ea5ee7 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -62,8 +62,4 @@ qt_add_resources(SOURCES ${CORE_RCS}) add_library(mod_core STATIC ${SOURCES}) qt_use_modules(mod_core Core Network Script Sql) -add_dependencies(mod_core mod_common) - -if (LIBS) - target_link_libraries(mod_core ${LIBS}) -endif() +target_link_libraries(mod_core mod_common ${LIBS}) diff --git a/src/qtui/CMakeLists.txt b/src/qtui/CMakeLists.txt index b66b090c..c9274a22 100644 --- a/src/qtui/CMakeLists.txt +++ b/src/qtui/CMakeLists.txt @@ -172,7 +172,6 @@ include_directories(${CMAKE_SOURCE_DIR}/src/common ${CMAKE_SOURCE_DIR}/src/qtui ${CMAKE_SOURCE_DIR}/src/qtui/settingspages ${CMAKE_SOURCE_DIR}/src/uisupport - ) qt_wrap_ui(UI ${FORMPATH} ${SPFRM}) @@ -185,8 +184,4 @@ endif() add_library(mod_qtui STATIC ${SOURCES} ${SPSRC} ${UI}) qt_use_modules(mod_qtui Core Gui Network ${QT_MODULES}) -if (LIBS) - target_link_libraries(mod_qtui ${LIBS}) -endif() - -add_dependencies(mod_qtui mod_common mod_client mod_uisupport) +target_link_libraries(mod_qtui mod_client mod_common mod_uisupport ${LIBS}) diff --git a/src/uisupport/CMakeLists.txt b/src/uisupport/CMakeLists.txt index 0019f515..52f386f6 100644 --- a/src/uisupport/CMakeLists.txt +++ b/src/uisupport/CMakeLists.txt @@ -34,7 +34,7 @@ set(SOURCES abstractnotificationbackend.h ) -if (KDE4_FOUND) +if (WITH_KDE4) include_directories(${KDE4_INCLUDES}) add_definitions(-DHAVE_KDE ${KDE4_DEFINITIONS}) set(SOURCES ${SOURCES} kcmdlinewrapper.cpp) @@ -51,8 +51,9 @@ endif() add_library(mod_uisupport STATIC ${SOURCES}) qt_use_modules(mod_uisupport Core Gui Network ${qt_modules}) -if (KDE4_FOUND) +target_link_libraries(mod_uisupport mod_client mod_common) + +if (WITH_KDE4) target_link_libraries(mod_uisupport ${KDE4_KDECORE_LIBS} ${KDE4_KDEUI_LIBRARY}) endif() -add_dependencies(mod_uisupport mod_common mod_client) -- 2.20.1