summaryrefslogtreecommitdiff
blob: 541a184ec8dbbe10296e7a0ed5a6c5e041a44b46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
From db3a04289d0f33285c3ca2d8fc05fc5bb45d608f Mon Sep 17 00:00:00 2001
From: Heiko Becker <heirecka@exherbo.org>
Date: Wed, 19 Jul 2017 22:28:32 +0200
Subject: Make sure the dbus xml interface file exists before it's used

Summary:
This started to happen with cmake 3.9, producing this erorr:
*** No rule to make target 'app/org.kde.khotkeys.xml', needed by
'kcm_hotkeys/khotkeys_interface.cpp'."

Test Plan: Builds fine with cmake 3.9.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6792
---
 app/CMakeLists.txt         | 8 ++++++--
 kcm_hotkeys/CMakeLists.txt | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt
index 0e6609f..2c1485e 100644
--- a/app/CMakeLists.txt
+++ b/app/CMakeLists.txt
@@ -1,10 +1,14 @@
 ########### next target ###############
 
+set(dbus_interface_name org.kde.khotkeys.xml)
 set(kded_khotkeys_PART_SRCS 
         kded.cpp
-        ${CMAKE_CURRENT_BINARY_DIR}/org.kde.khotkeys.xml)
+        ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
 
-qt5_generate_dbus_interface(kded.h org.kde.khotkeys.xml )
+qt5_generate_dbus_interface(kded.h ${dbus_interface_name})
+set(dbus_interface_xml ${CMAKE_CURRENT_BINARY_DIR}/${dbus_interface_name})
+
+add_custom_target(khotkeysdbusinterface ALL DEPENDS ${dbus_interface_name})
 
 add_library(kded_khotkeys MODULE ${kded_khotkeys_PART_SRCS})
 set_target_properties(kded_khotkeys PROPERTIES OUTPUT_NAME khotkeys)
diff --git a/kcm_hotkeys/CMakeLists.txt b/kcm_hotkeys/CMakeLists.txt
index f0ef3d3..0df2b5c 100644
--- a/kcm_hotkeys/CMakeLists.txt
+++ b/kcm_hotkeys/CMakeLists.txt
@@ -82,6 +82,7 @@ add_library(
     MODULE
     ${kcm_hotkeys_PART_SRCS}
     )
+add_dependencies(kcm_hotkeys khotkeysdbusinterface)
 
 target_compile_definitions(kcm_hotkeys PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
 
-- 
cgit v0.11.2