summaryrefslogtreecommitdiff
blob: cce395a837fff9d359ca4803921d7be291365cd3 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
From 57fef3b1d54959d5b719469c7c67e1d3e7be49dc Mon Sep 17 00:00:00 2001
From: Ralf Habacker <ralf.habacker@freenet.de>
Date: Fri, 30 Oct 2020 08:32:41 +0100
Subject: [PATCH] Add support to use external KDevPHP packaga

If no external development package has been found fallback to embedded
version.

This commit adds an additional optional dependency for the KDevPHP package, which
named e.g. on openSUSE 'kdevelop5-plugin-php-devel'.

BUG:428460
FIXED-IN:2.32.80 (KDE releases 20.11.80)
---
 CMakeLists.txt                    | 20 ++++++++++++++------
 umbrello/codeimport/phpimport.cpp | 19 +++++++++++--------
 2 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 221c04e31..398415f09 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -129,18 +129,26 @@ if(KDEVPGQT_FOUND AND KDEVPLATFORM_FOUND)
     include_directories(
         ${KDEVPGQT_INCLUDE_DIR}
         ${KDEVPLATFORM_INCLUDE_DIR}
-        ${CMAKE_SOURCE_DIR}/${KDEV_SOURCE_DIR}/parser
-        ${CMAKE_BINARY_DIR}/${KDEV_SOURCE_DIR}/parser
     )
-    set(NO_INSTALL 1)
-    set(BUILD_PARSER_ONLY 1)
     set(BUILD_PHP_IMPORT 1)
     add_definitions(
-        -DKDEVPHPPARSER_EXPORT=
         -DENABLE_PHP_IMPORT
     )
     add_subdirectory(lib/kdevplatform)
-    add_subdirectory(${KDEV_SOURCE_DIR})
+    find_package(KDevPHP)
+    if(NOT KDevPHP_FOUND)
+        set(NO_INSTALL 1)
+        set(BUILD_PARSER_ONLY 1)
+        set(BUILD_PHP_IMPORT 1)
+        add_definitions(
+            -DKDEVPHPPARSER_EXPORT=
+        )
+        include_directories(
+            ${CMAKE_SOURCE_DIR}/${KDEV_SOURCE_DIR}
+            ${CMAKE_BINARY_DIR}/${KDEV_SOURCE_DIR}
+        )
+        add_subdirectory(${KDEV_SOURCE_DIR})
+    endif()
 else()
     set(BUILD_PHP_IMPORT 0)
 endif()
diff --git a/umbrello/codeimport/phpimport.cpp b/umbrello/codeimport/phpimport.cpp
index f45f1416f..f714dcbad 100644
--- a/umbrello/codeimport/phpimport.cpp
+++ b/umbrello/codeimport/phpimport.cpp
@@ -39,18 +39,21 @@ QTextStream qout(stdout);
 QTextStream qerr(stderr);
 QTextStream qin(stdin);
 
-#include "parsesession.h"
-#include "phplexer.h"
-#include "phpparser.h"
-#include "phpdebugvisitor.h"
-#include "phpast.h"
-#include "tokenstream.h"
-#include "phptokentext.h"
-
+// kdevphp
+#include <parser/parsesession.h>
+#include <parser/phplexer.h>
+#include <parser/phpparser.h>
+#include <parser/phpdebugvisitor.h>
+#include <parser/phpast.h>
+#include <parser/tokenstream.h>
+#include <parser/phptokentext.h>
+
+// kdevplatform
 #include <tests/autotestshell.h>
 #include <language/duchain/duchain.h>
 #include <language/duchain/problem.h>
 #include <language/codegen/coderepresentation.h>
+#include <language/editor/documentrange.h>
 #include <tests/testcore.h>
 
 namespace Php {
-- 
GitLab