diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f7a50d1..53101ee3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,10 @@ ecm_setup_version(1.4.0 VERSION_HEADER ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h ) +# Make the version header available by linking against kdeconnectversion +add_library(kdeconnectversion INTERFACE) +target_include_directories(kdeconnectversion INTERFACE ${CMAKE_CURRENT_BINARY_DIR}) + if (SAILFISHOS) set(KF5_REQUIRED_COMPONENTS I18n CoreAddons Config) set(KF5_OPTIONAL_COMPONENTS) diff --git a/cli/CMakeLists.txt b/cli/CMakeLists.txt index 23a97aa4b..647958802 100644 --- a/cli/CMakeLists.txt +++ b/cli/CMakeLists.txt @@ -3,11 +3,10 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-cli\") add_executable(kdeconnect-cli kdeconnect-cli.cpp) ecm_mark_nongui_executable(kdeconnect-cli) -target_include_directories(kdeconnect-cli PUBLIC ${CMAKE_BINARY_DIR}) - target_link_libraries(kdeconnect-cli kdeconnectinterfaces kdeconnectcore + kdeconnectversion KF5::CoreAddons KF5::I18n ) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 92f57a12b..2778ed1f3 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -52,7 +52,7 @@ set(kdeconnectcore_SRCS add_library(kdeconnectcore ${kdeconnectcore_SRCS}) -target_include_directories(kdeconnectcore PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_SOURCE_DIR}) +target_include_directories(kdeconnectcore PUBLIC ${PROJECT_SOURCE_DIR}) target_link_libraries(kdeconnectcore PUBLIC diff --git a/daemon/CMakeLists.txt b/daemon/CMakeLists.txt index 310ad6092..4f1e3c5e9 100644 --- a/daemon/CMakeLists.txt +++ b/daemon/CMakeLists.txt @@ -8,8 +8,7 @@ ecm_qt_declare_logging_category( EXPORT kdeconnect-kde DESCRIPTION "kdeconnect (daemon)") add_executable(kdeconnectd kdeconnectd.cpp ${debug_file_SRCS}) -target_include_directories(kdeconnectd PUBLIC ${CMAKE_BINARY_DIR}) -target_link_libraries(kdeconnectd kdeconnectcore KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) +target_link_libraries(kdeconnectd kdeconnectcore kdeconnectversion KF5::KIOWidgets KF5::DBusAddons KF5::Notifications KF5::I18n Qt5::Widgets) ecm_mark_nongui_executable(kdeconnectd) diff --git a/indicator/CMakeLists.txt b/indicator/CMakeLists.txt index 8f46e5143..6c4027362 100644 --- a/indicator/CMakeLists.txt +++ b/indicator/CMakeLists.txt @@ -19,8 +19,7 @@ else () endif() add_executable(kdeconnect-indicator ${indicator_SRCS}) -target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_BINARY_DIR}) -target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces kdeconnectcore) +target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces kdeconnectcore kdeconnectversion) if (WIN32) add_compile_definitions(QSYSTRAY) endif() diff --git a/kcmplugin/CMakeLists.txt b/kcmplugin/CMakeLists.txt index f95e33cda..7cc35c859 100644 --- a/kcmplugin/CMakeLists.txt +++ b/kcmplugin/CMakeLists.txt @@ -17,7 +17,6 @@ set_target_properties(kdeconnectpluginkcm PROPERTIES SOVERSION ${KDECONNECT_VERSION_MAJOR} ) -target_include_directories(kdeconnectpluginkcm PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) generate_export_header(kdeconnectpluginkcm EXPORT_FILE_NAME kdeconnectpluginkcm_export.h BASE_NAME kdeconnectpluginkcm) # Remove NAMELINK_SKIP if/when headers are being installed and the library becomes public. diff --git a/smsapp/CMakeLists.txt b/smsapp/CMakeLists.txt index 07dd6beef..f7ef1e5c8 100644 --- a/smsapp/CMakeLists.txt +++ b/smsapp/CMakeLists.txt @@ -24,7 +24,7 @@ add_library(kdeconnectsmshelper STATIC ${smshelper_debug_file_SRCS} ) -target_include_directories(kdeconnectsmshelper PUBLIC ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(kdeconnectsmshelper PUBLIC ${CMAKE_SOURCE_DIR}) target_link_libraries(kdeconnectsmshelper PUBLIC @@ -43,11 +43,10 @@ add_executable(kdeconnect-sms resources.qrc ${sms_debug_files_SRCS}) -target_include_directories(kdeconnect-sms PUBLIC ${CMAKE_BINARY_DIR}) - target_link_libraries(kdeconnect-sms kdeconnectsmshelper kdeconnectinterfaces + kdeconnectversion Qt5::Quick Qt5::Widgets KF5::CoreAddons diff --git a/urlhandler/CMakeLists.txt b/urlhandler/CMakeLists.txt index 2006235a3..0ef5cfe53 100644 --- a/urlhandler/CMakeLists.txt +++ b/urlhandler/CMakeLists.txt @@ -2,11 +2,10 @@ ki18n_wrap_ui(telhandler_SRCS dialog.ui) add_executable(kdeconnect-handler kdeconnect-handler.cpp ${telhandler_SRCS}) -target_include_directories(kdeconnect-handler PUBLIC ${CMAKE_BINARY_DIR}) - target_link_libraries(kdeconnect-handler kdeconnectinterfaces kdeconnectcore + kdeconnectversion Qt5::Widgets KF5::CoreAddons KF5::I18n