This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
/
CMakeLists.txt
113 lines (94 loc) · 3.21 KB
/
CMakeLists.txt
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
set (CMAKE_AUTOMOC ON)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
set (DISCOUNT_FIND_QUIETLY ON)
if (APPLE)
list (APPEND CMAKE_PREFIX_PATH "/usr/local/opt/qt5" "/usr/local/opt/qt@5.5") # Provide list of default paths for Homebrew’s Qt
endif (APPLE)
set (QCOMPONENTS Core Quick Gui Qml Widgets Test)
find_package (Qt5 COMPONENTS ${QCOMPONENTS})
find_package (
Qt5
OPTIONAL_COMPONENTS Svg
QUIET)
find_package (
Qt5
OPTIONAL_COMPONENTS DBus
QUIET)
find_package (Discount)
if (NOT Qt5_FOUND)
remove_tool (qt-gui "qt5 (Components: ${QCOMPONENTS}) not found")
elseif (NOT DISCOUNT_FOUND)
remove_tool (qt-gui "discount or libmarkdown-dev not found")
else ()
if (NOT Qt5Svg_FOUND)
message (WARNING "No Qt5 svg module found. Svg icons themes will not be supported. (please install libqt5svg5-dev)")
endif ()
if (NOT Qt5DBus_FOUND)
message (WARNING "No Qt5 DBus module found. Listening to DBus will not be supported.")
add_definitions (-DHAVE_DBUS=0)
else ()
add_definitions (-DHAVE_DBUS=1)
endif ()
include_directories (${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
include_directories (
SYSTEM
${Qt5Quick_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Core_INCLUDE_DIRS}
${Qt5Qml_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Test_INCLUDE_DIRS}
${Qt5Svg_INCLUDE_DIRS}
src/markdownconverter)
file (GLOB qt-gui_HDRS "src/markdownconverter/*.h" "src/markdownconverter/template/*.h")
add_headers (qt-gui_HDRS)
add_cppheaders (qt-gui_HDRS)
add_toolheaders (qt-gui_HDRS)
file (GLOB qt-gui_SRCS "src/*.cpp" "src/markdownconverter/*.cpp" "src/markdownconverter/template/*.cpp")
set (qt-gui_RSCS resources.qrc)
set_property (SOURCE qrc_resources.cpp PROPERTY SKIP_AUTOMOC ON)
qt5_add_resources (RSCS ${qt-gui_RSCS})
add_executable (qt-gui ${qt-gui_SRCS} ${qt-gui_HDRS} ${UIS} ${RSCS} ${TRS})
target_link_libraries (qt-gui Qt5::Quick Qt5::Gui Qt5::Core Qt5::Qml Qt5::Widgets)
include_directories (${DISCOUNT_INCLUDES})
target_link_libraries (qt-gui ${DISCOUNT_LIBRARIES})
target_link_libraries (
qt-gui
${Qt5Quick_LIBRARIES}
${Qt5Gui_LIBRARIES}
${Qt5Core_LIBRARIES}
${Qt5Qml_LIBRARIES}
${Qt5Widgets_LIBRARIES}
${Qt5Svg_LIBRARIES}
${Qt5Test_LIBRARIES}
${Qt5DBus_LIBRARIES})
tool_link_elektratools (qt-gui elektra-ease)
install (
TARGETS qt-gui
DESTINATION ${TARGET_TOOL_EXEC_FOLDER}
COMPONENT elektra-qt-gui)
configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/elektra-qt-editor.in" "${CMAKE_CURRENT_BINARY_DIR}/elektra-qt-editor")
install (
PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/elektra-qt-editor"
DESTINATION bin
COMPONENT elektra-qt-gui)
install (
FILES org.libelektra.elektra-qt-editor.desktop
DESTINATION share/applications
COMPONENT elektra-qt-gui)
install (
FILES org.libelektra.elektra-qt-editor.appdata.xml
DESTINATION share/appdata
COMPONENT elektra-qt-gui)
install (
FILES ../../../doc/images/logo/logo_color.svg
DESTINATION share/icons/hicolor/scalable/apps
RENAME elektra.svg
COMPONENT elektra-qt-gui)
install (
FILES ../../../doc/images/logo/logo_gray.svg
DESTINATION share/icons/hicolor/scalable/apps
RENAME elektra-symbolic.svg
COMPONENT elektra-qt-gui)
generate_manpage (kdb-qt-gui FILENAME ${CMAKE_CURRENT_SOURCE_DIR}/README.md COMPONENT elektra-qt-gui)
endif ()