forked from KDAB/hotspot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
174 lines (149 loc) · 4.71 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
cmake_minimum_required(VERSION 3.16)
project(
hotspot
VERSION 1.4.80
LANGUAGES CXX C
)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/perfparser/cmake/ ${CMAKE_CURRENT_SOURCE_DIR}/cmake/
${CMAKE_MODULE_PATH}
)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
if(NOT DEFINED CMAKE_INSTALL_RPATH_USE_LINK_PATH)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE
"Release"
CACHE STRING "" FORCE
)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
option(APPIMAGE_BUILD "configure build for bundling in an appimage" OFF)
option(QT6_BUILD "configure build to use Qt6/KF6" OFF)
# Enable the test harness
enable_testing()
# Version setup
set(HOTSPOT_VERSION_STRING "${hotspot_VERSION}")
include(HotspotMacrosInternal)
include(FeatureSummary)
if(QT6_BUILD)
set(QT_MAJOR_VERSION 6)
set(QT_MIN_VERSION 6.4)
set(KDDW_SUFFIX "-qt6")
else()
set(QT_MAJOR_VERSION 5)
set(QT_MIN_VERSION 5.15)
set(KDDW_SUFFIX "")
endif()
find_package(
Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION}
COMPONENTS Core
Widgets
Network
Test
Svg
REQUIRED
)
find_package(LibElf REQUIRED)
find_package(ElfUtils REQUIRED)
find_package(ECM 1.0.0 NO_MODULE REQUIRED)
find_package(Threads REQUIRED)
find_package(Zstd)
find_package(objdump)
set_package_properties(
objdump PROPERTIES
DESCRIPTION "Utility to generate disassembler"
PURPOSE "Support for annotating individual instructions"
URL "https://www.gnu.org/software/binutils/"
TYPE RUNTIME
)
find_package(LibRustcDemangle)
set_package_properties(
LibRustcDemangle PROPERTIES
DESCRIPTION "Demangling for Rust symbols, written in Rust."
PURPOSE "Demangling of Rust symbols"
URL "https://github.com/alexcrichton/rustc-demangle"
TYPE RUNTIME
)
find_package(LibDDemangle)
set_package_properties(
LibDDemangle PROPERTIES
DESCRIPTION "Demangling for D symbols, written in D."
PURPOSE "Demangling of D symbols"
URL "https://github.com/lievenhey/d_demangler"
TYPE RUNTIME
)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})
find_package(
KF${QT_MAJOR_VERSION} 5.42.0
COMPONENTS ThreadWeaver
ConfigWidgets
CoreAddons
ItemViews
ItemModels
KIO
Solid
WindowSystem
Notifications
IconThemes
Parts
I18n
REQUIRED
)
find_package(KF${QT_MAJOR_VERSION}Archive 5.85.0 CONFIG)
set(KFArchive_FOUND ${KF${QT_MAJOR_VERSION}Archive_FOUND})
find_package(KF${QT_MAJOR_VERSION}SyntaxHighlighting CONFIG)
set(KFSyntaxHighlighting_FOUND ${KF${QT_MAJOR_VERSION}SyntaxHighlighting_FOUND})
find_package(KDDockWidgets${KDDW_SUFFIX} CONFIG)
set_package_properties(
KDDockWidgets${KDDW_SUFFIX} PROPERTIES
PURPOSE
"KDDockWidgets is a Qt dock widget library written by KDAB, suitable for replacing QDockWidget and implementing
advanced functionalities missing in Qt. https://github.com/KDAB/KDDockWidgets"
TYPE REQUIRED
)
find_package(QCustomPlot)
set_package_properties(
QCustomPlot PROPERTIES
DESCRIPTION "QCustomPlot is a Qt charting library. https://www.qcustomplot.com/"
PURPOSE "Frequency tab"
URL "https://www.qcustomplot.com/index.php/download"
TYPE OPTIONAL
)
find_package(KGraphViewerPart CONFIG)
set_package_properties(
KGraphViewerPart PROPERTIES
DESCRIPTION "KGraphViewer (from KDE extragear) is a tool to display graphviz .dot graphs"
PURPOSE "Call graph in the caller/callee tab"
URL "https://invent.kde.org/graphics/kgraphviewer"
TYPE OPTIONAL
)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(ECMAddTests)
include(ECMCoverageOption)
include(ECMEnableSanitizers)
file(RELATIVE_PATH LIBEXEC_REL_PATH "${KDE_INSTALL_FULL_BINDIR}" "${KDE_INSTALL_FULL_LIBEXECDIR}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/hotspot-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/hotspot-config.h @ONLY)
add_definitions(-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_USE_QSTRINGBUILDER)
add_compile_options(-Wall -pedantic -Wextra)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wno-gnu-zero-variadic-macro-arguments)
endif()
add_subdirectory(3rdparty)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(src)
add_subdirectory(tests)
install(
FILES com.kdab.hotspot.desktop
DESTINATION ${KDE_INSTALL_APPDIR}
)
install(
FILES com.kdab.Hotspot.appdata.xml
DESTINATION ${KDE_INSTALL_METAINFODIR}
)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)