Use link dependencies between Quassel modules
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 3 Jan 2015 00:19:10 +0000 (01:19 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 3 Jan 2015 00:19:10 +0000 (01:19 +0100)
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
src/common/CMakeLists.txt
src/core/CMakeLists.txt
src/qtui/CMakeLists.txt
src/uisupport/CMakeLists.txt

index 3dd1504..4f0106c 100644 (file)
@@ -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)
index 23e5601..fa48020 100644 (file)
@@ -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})
index 6a0611a..a9ea5ee 100644 (file)
@@ -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})
index b66b090..c9274a2 100644 (file)
@@ -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})
index 0019f51..52f386f 100644 (file)
@@ -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)