app-text/kbibtex: 0.6.2 version bump, add USE=webkit
[gentoo.git] / app-text / kbibtex / files / kbibtex-0.6.2-webkit.patch
1 commit 2cd09d41ed559461a0f0a346ebec3dea82c06947
2 Author: Andreas Sturmlechner <andreas.sturmlechner@gmail.com>
3 Date:   Sat Jan 21 18:26:46 2017 +0100
4
5     Add option to disable Qt4WebKit even if present
6     
7     - Link against Qt4WebKit only if(HAVE_WEBKIT)
8     - Remove Qt4WebKit linking from tests
9     
10     REVIEW: 129863
11
12 diff --git a/CMakeLists.txt b/CMakeLists.txt
13 index ee3d810..1acbf8a 100644
14 --- a/CMakeLists.txt
15 +++ b/CMakeLists.txt
16 @@ -48,6 +48,12 @@ set(
17  )
18  
19  option(
20 +    WITH_QTWEBKIT
21 +    "Enable QtWebkit support"
22 +    ON
23 +)
24 +
25 +option(
26      UNITY_BUILD
27      "Compile multiple C++ files in one big, merged file (\"Unity build\")\nSee also http://t-fischer.dreamwidth.org/3054.html"
28  )
29 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
30 index 04222a7..0b7be01 100644
31 --- a/src/CMakeLists.txt
32 +++ b/src/CMakeLists.txt
33 @@ -37,24 +37,41 @@ include(
34  # check if QtWebKit is available, which seems to be not available
35  # on e.g. RedHat Enterprise Linux 6 or Scientific Linux 6
36  if(
37 -    QT_QTWEBKIT_FOUND
38 +    WITH_QTWEBKIT
39  )
40 -    message(
41 -        STATUS
42 -        "Found QtWebKit, enabling WebKit support"
43 +    if(
44 +        QT_QTWEBKIT_FOUND
45 +    )
46 +        message(
47 +            STATUS
48 +            "Found QtWebKit, enabling WebKit support"
49 +        )
50 +        add_definitions(
51 +            -DHAVE_QTWEBKIT
52 +        )
53 +        set(
54 +            OPTIONAL_QTWEBKIT_LIBRARIES
55 +            ${QT_QTWEBKIT_LIBRARIES}
56 +        )
57 +    else(
58 +        QT_QTWEBKIT_FOUND
59      )
60 -    add_definitions(
61 -        -DHAVE_QTWEBKIT
62 +        message(
63 +            STATUS
64 +            "QtWebKit not found, disabling WebKit support"
65 +        )
66 +    endif(
67 +        QT_QTWEBKIT_FOUND
68      )
69  else(
70 -    QT_QTWEBKIT_FOUND
71 +    WITH_QTWEBKIT
72  )
73      message(
74          STATUS
75 -        "QtWebKit not found, disabling WebKit support"
76 +        "QtWebKit support disabled by configure"
77      )
78  endif(
79 -    QT_QTWEBKIT_FOUND
80 +    WITH_QTWEBKIT
81  )
82  
83  add_definitions(
84 diff --git a/src/networking/CMakeLists.txt b/src/networking/CMakeLists.txt
85 index efa14f4..f7ade08 100644
86 --- a/src/networking/CMakeLists.txt
87 +++ b/src/networking/CMakeLists.txt
88 @@ -131,7 +131,7 @@ target_link_libraries(
89      kbibtexnetworking
90      LINK_PRIVATE
91      ${QT_QTCORE_LIBRARY}
92 -    ${QT_QTWEBKIT_LIBRARY}
93 +    ${OPTIONAL_QTWEBKIT_LIBRARIES}
94      ${KDE4_KDECORE_LIBS}
95      ${KDE4_KIO_LIBS}
96      ${POPPLER_QT4_LIBRARIES}
97 diff --git a/src/program/CMakeLists.txt b/src/program/CMakeLists.txt
98 index a9fe213..fa57506 100644
99 --- a/src/program/CMakeLists.txt
100 +++ b/src/program/CMakeLists.txt
101 @@ -65,7 +65,7 @@ kde4_add_executable(
102  target_link_libraries(
103      kbibtex
104      LINK_PRIVATE
105 -    ${QT_QTWEBKIT_LIBRARIES}
106 +    ${OPTIONAL_QTWEBKIT_LIBRARIES}
107      ${KDE4_KIO_LIBS}
108      ${KDE4_KPARTS_LIBS}
109      ${KDE4_KFILE_LIBS}