summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2015-04-08 12:19:58 +0200
committerAleix Pol <[email protected]>2015-04-08 12:20:06 +0200
commit0c300584fe8ca5747c324202e0f6a8cf8c8c5f8e (patch)
treee9a2af76c7b49ba21751349a15e45d08299d9542
parent297ed5d4d32715d991123934169fe2eadec9485c (diff)
Export KAccounts dependencies automatically
Exposes what libraries and include directories are exposed by KAccounts. This way it's easier to link against it since we just need to specify the dependency. REVIEW: 123285
-rw-r--r--CMakeLists.txt5
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/daemon/CMakeLists.txt4
-rw-r--r--src/lib/CMakeLists.txt14
-rw-r--r--tests/CMakeLists.txt2
5 files changed, 11 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35aac8d..33a5914 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,11 +33,6 @@ include(KDECompilerSettings)
include(ECMInstallIcons)
include(FeatureSummary)
-include_directories(
- ${ACCOUNTSQT_INCLUDE_DIRS}
- ${SIGNONQT_INCLUDE_DIRS}
-)
-
remove_definitions(-DQT_NO_CAST_FROM_ASCII)
add_subdirectory(src)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f6aeb41..f28ebb6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -26,10 +26,10 @@ target_link_libraries(kcm_kaccounts
KF5::I18n
KF5::KCMUtils
KF5::IconThemes
- ${ACCOUNTSQT_LIBRARIES}
${SIGNONQT_LIBRARIES}
kaccounts
)
+target_include_directories(kcm_kaccounts PRIVATE "${SIGNONQT_INCLUDE_DIRS}")
install(TARGETS kcm_kaccounts DESTINATION ${PLUGIN_INSTALL_DIR})
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index 59b14ad..5190616 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -25,8 +25,6 @@ target_link_libraries(kded_accounts
KF5::I18n
KF5::DBusAddons
kaccounts
- ${ACCOUNTSQT_LIBRARIES}
- ${SIGNONQT_LIBRARIES}
)
install(TARGETS kded_accounts DESTINATION ${PLUGIN_INSTALL_DIR})
@@ -60,4 +58,4 @@ if (KF5Akonadi_FOUND)
DESTINATION ${PLUGIN_INSTALL_DIR}/kaccounts/daemonplugins
)
-endif() \ No newline at end of file
+endif()
diff --git a/src/lib/CMakeLists.txt b/src/lib/CMakeLists.txt
index 704f10a..6478cee 100644
--- a/src/lib/CMakeLists.txt
+++ b/src/lib/CMakeLists.txt
@@ -30,14 +30,16 @@ add_library (kaccounts SHARED
${kaccountslib_SRCS}
)
-target_link_libraries (kaccounts Qt5::Core
- Qt5::Xml
- KF5::CoreAddons
- ${ACCOUNTSQT_LIBRARIES}
- ${SIGNONQT_LIBRARIES}
+target_link_libraries (kaccounts
+ PUBLIC
+ KF5::CoreAddons
+ ${ACCOUNTSQT_LIBRARIES}
+ Qt5::Xml
+ PRIVATE
+ ${SIGNONQT_LIBRARIES}
)
-target_include_directories(kaccounts INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/KAccounts>")
+target_include_directories(kaccounts INTERFACE "$<INSTALL_INTERFACE:${INCLUDE_INSTALL_DIR}/KAccounts>" PUBLIC "${ACCOUNTSQT_INCLUDE_DIRS}" PRIVATE "${SIGNONQT_INCLUDE_DIRS}")
set_target_properties(kaccounts PROPERTIES VERSION ${KACCOUNTS_VERSION}
SOVERSION ${KACCOUNTS_SOVERSION}
EXPORT_NAME KAccounts
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index cc0ef5a..a92a434 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -3,7 +3,7 @@ include(ECMMarkAsTest)
find_package(Qt5 5.2.0 CONFIG REQUIRED Test)
add_definitions("-DTEST_DATA=\"${CMAKE_CURRENT_SOURCE_DIR}/data/\"")
-include_directories(${CMAKE_CURRENT_BINARY_DIR})
+include_directories(${CMAKE_CURRENT_BINARY_DIR} ${ACCOUNTSQT_INCLUDE_DIRS} ${SIGNONQT_INCLUDE_DIRS})
set(COMMON_LINK_LIBS Qt5::Test Qt5::Core Qt5::Xml Qt5::DBus KF5::CoreAddons ${ACCOUNTSQT_LIBRARIES})
set(testname testproviderconfig)