CMakeLists.txt 109 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. cmake_minimum_required(VERSION 3.16.0...3.30)
  3. list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/packaging/cmake/Modules")
  4. include(NetdataVersion)
  5. netdata_version()
  6. project(netdata
  7. VERSION "${NETDATA_VERSION_MAJOR}.${NETDATA_VERSION_MINOR}.${NETDATA_VERSION_PATCH}.${NETDATA_VERSION_TWEAK}"
  8. HOMEPAGE_URL "https://www.netdata.cloud"
  9. LANGUAGES C CXX)
  10. include(CMakeDependentOption)
  11. if(DEFINED BUILD_SHARED_LIBS)
  12. if(NOT BUILD_SHARED_LIBS)
  13. set(STATIC_BUILD TRUE)
  14. endif()
  15. endif()
  16. if(STATIC_BUILD)
  17. set(CMAKE_FIND_LIBRARY_PREFIXES "${CMAKE_STATIC_LIBRARY_PREFIX}")
  18. set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
  19. endif()
  20. find_package(PkgConfig REQUIRED)
  21. if(STATIC_BUILD)
  22. list(APPEND PKG_CONFIG_EXECUTABLE "--static")
  23. endif()
  24. set(CMAKE_C_STANDARD 11)
  25. set(CMAKE_CXX_STANDARD 14)
  26. set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "netdata")
  27. option(USE_CXX_11 "Use C++11 instead of C++14 (should only be used on legacy systems that cannot support C++14, may disable some features)" False)
  28. mark_as_advanced(USE_CXX_11)
  29. if(USE_CXX_11)
  30. set(CMAKE_CXX_STANDARD 11)
  31. endif()
  32. set(CMAKE_C_STANDARD_REQUIRED On)
  33. set(CMAKE_CXX_STANDARD_REQUIRED On)
  34. set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
  35. if(NOT CMAKE_BUILD_TYPE)
  36. set(CMAKE_BUILD_TYPE "Release")
  37. endif()
  38. include(NetdataCompilerFlags)
  39. set(CMAKE_EXPORT_COMPILE_COMMANDS On)
  40. # Check for the mold linker and try to use it if available
  41. option(USE_MOLD "If the MOLD linker is available on the system, use it instead of the default linker." TRUE)
  42. if(USE_MOLD)
  43. message(CHECK_START "Searching for MOLD linker")
  44. find_program(MOLD_LINKER NAMES ld.mold mold)
  45. if(MOLD_LINKER)
  46. execute_process(COMMAND ${MOLD_LINKER} --version
  47. RESULT_VARIABLE MOLD_VERSION_RESULT
  48. OUTPUT_VARIABLE MOLD_VERSION)
  49. if(NOT MOLD_VERSION_RESULT)
  50. string(REPLACE "\n" "" MOLD_VERSION "${MOLD_VERSION}")
  51. message(CHECK_PASS "found (version: ${MOLD_VERSION})")
  52. message(STATUS "Using mold instead of the system default for linking.")
  53. add_link_options("-fuse-ld=mold")
  54. else()
  55. message(CHECK_FAIL "failed")
  56. endif()
  57. else()
  58. message(CHECK_FAIL "failed")
  59. endif()
  60. endif()
  61. set(CONFIG_H_DIR ${CMAKE_BINARY_DIR})
  62. set(CONFIG_H ${CONFIG_H_DIR}/config.h)
  63. #
  64. # detect OS
  65. #
  66. set(OS_FREEBSD False)
  67. set(OS_LINUX False)
  68. set(OS_MACOS False)
  69. set(OS_WINDOWS False)
  70. set(NETDATA_RUNTIME_PREFIX "${CMAKE_INSTALL_PREFIX}")
  71. set(BINDIR usr/sbin)
  72. if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
  73. set(OS_MACOS True)
  74. find_library(IOKIT IOKit)
  75. find_library(FOUNDATION Foundation)
  76. message(INFO " Compiling for MacOS... ")
  77. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
  78. set(OS_FREEBSD True)
  79. message(INFO " Compiling for FreeBSD... ")
  80. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
  81. set(OS_LINUX True)
  82. add_definitions(-D_GNU_SOURCE)
  83. message(INFO " Compiling for Linux... ")
  84. elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "MSYS" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  85. set(OS_WINDOWS True)
  86. if(NOT "${CMAKE_INSTALL_PREFIX}" STREQUAL "/opt/netdata")
  87. message(FATAL_ERROR "CMAKE_INSTALL_PREFIX must be set to /opt/netdata, but it is set to ${CMAKE_INSTALL_PREFIX}")
  88. endif()
  89. if(BUILD_FOR_PACKAGING)
  90. set(NETDATA_RUNTIME_PREFIX "/")
  91. endif()
  92. set(BINDIR usr/bin)
  93. add_definitions(-D_GNU_SOURCE)
  94. if($ENV{CLION_IDE})
  95. # clion needs these to find the includes
  96. if("${CMAKE_SYSTEM_NAME}" STREQUAL "MSYS" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
  97. if("$ENV{MSYSTEM}" STREQUAL "MSYS")
  98. include_directories(c:/msys64/usr/include)
  99. include_directories(c:/msys64/usr/include/w32api)
  100. elseif("$ENV{MSYSTEM}" STREQUAL "MINGW64")
  101. include_directories(c:/msys64/mingw64/include)
  102. elseif("$ENV{MSYSTEM}" STREQUAL "UCRT64")
  103. include_directories(c:/msys64/ucrt64/include)
  104. endif()
  105. endif()
  106. endif()
  107. message(INFO " Compiling for Windows (${CMAKE_SYSTEM_NAME}, MSYSTEM=$ENV{MSYSTEM})... ")
  108. else()
  109. message(FATAL_ERROR "Unknown/unsupported platform: ${CMAKE_SYSTEM_NAME} (Supported platforms: FreeBSD, Linux, macOS, Windows)")
  110. endif()
  111. # This is intended to make life easier for developers who are working on one
  112. # specific feature.
  113. option(DEFAULT_FEATURE_STATE "Specify the default state for most optional features" True)
  114. mark_as_advanced(DEFAULT_FEATURE_STATE)
  115. # High-level features
  116. option(ENABLE_ACLK "Enable Netdata Cloud support (ACLK)" ${DEFAULT_FEATURE_STATE})
  117. option(ENABLE_CLOUD "Enable Netdata Cloud by default at runtime" ${DEFAULT_FEATURE_STATE})
  118. option(ENABLE_ML "Enable machine learning features" ${DEFAULT_FEATURE_STATE})
  119. option(ENABLE_DBENGINE "Enable dbengine metrics storage" True)
  120. # Data collection plugins
  121. option(ENABLE_PLUGIN_APPS "Enable per-process resource usage monitoring" ${DEFAULT_FEATURE_STATE})
  122. option(ENABLE_PLUGIN_GO "Enable metric collectors written in Go" ${DEFAULT_FEATURE_STATE})
  123. cmake_dependent_option(ENABLE_PLUGIN_CUPS "Enable CUPS monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX OR OS_FREEBSD OR OS_MACOS" False)
  124. cmake_dependent_option(ENABLE_PLUGIN_FREEIPMI "Enable IPMI monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX OR OS_FREEBSD" False)
  125. cmake_dependent_option(ENABLE_PLUGIN_CGROUP_NETWORK "Enable Linux CGroup network usage monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  126. cmake_dependent_option(ENABLE_PLUGIN_DEBUGFS "Enable Linux DebugFS metric collection" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  127. cmake_dependent_option(ENABLE_PLUGIN_EBPF "Enable Linux eBPF metric collection" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  128. cmake_dependent_option(ENABLE_LEGACY_EBPF_PROGRAMS "Enable eBPF programs for kernels without BTF support" True "ENABLE_PLUGIN_EBPF" False)
  129. mark_as_advanced(ENABLE_LEGACY_EBPF_PROGRAMS)
  130. cmake_dependent_option(ENABLE_PLUGIN_LOCAL_LISTENERS "Enable local listening socket tracking (including service auto-discovery support)" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  131. cmake_dependent_option(ENABLE_PLUGIN_NETWORK_VIEWER "Enable network viewer functionality" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  132. cmake_dependent_option(ENABLE_PLUGIN_NFACCT "Enable Linux NFACCT metric collection" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  133. cmake_dependent_option(ENABLE_PLUGIN_PERF "Enable Linux performance counter monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  134. cmake_dependent_option(ENABLE_PLUGIN_SLABINFO "Enable Linux kernel SLAB allocator monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  135. cmake_dependent_option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "Enable systemd journal log collection" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  136. cmake_dependent_option(ENABLE_PLUGIN_XENSTAT "Enable Xen domain monitoring" ${DEFAULT_FEATURE_STATE} "OS_LINUX" False)
  137. # Metrics exporters
  138. option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "Enable exporting to Prometheus via remote write API" ${DEFAULT_FEATURE_STATE})
  139. option(ENABLE_EXPORTER_MONGODB "Enable exporting to MongoDB" ${DEFAULT_FEATURE_STATE})
  140. # Vendoring
  141. option(ENABLE_BUNDLED_JSONC "Force use of a vendored copy of JSON-C" False)
  142. option(ENABLE_BUNDLED_YAML "Force use of a vendored copy of libyaml" False)
  143. option(ENABLE_BUNDLED_PROTOBUF "Use a vendored copy of protobuf" False)
  144. # Experimental features
  145. option(ENABLE_WEBRTC "Enable WebRTC dashboard communications (experimental)" False)
  146. mark_as_advanced(ENABLE_WEBRTC)
  147. option(ENABLE_H2O "Enable H2O web server (experimental)" True)
  148. mark_as_advanced(ENABLE_H2O)
  149. # Other optional functionality
  150. option(ENABLE_SENTRY "Build with Sentry Native crash reporting" False)
  151. mark_as_advanced(ENABLE_SENTRY)
  152. option(BUILD_FOR_PACKAGING "Include component files for native packages" False)
  153. mark_as_advanced(BUILD_FOR_PACKAGING)
  154. cmake_dependent_option(FORCE_LEGACY_LIBBPF "Force usage of libbpf 0.0.9 instead of the latest version." False "ENABLE_PLUGIN_EBPF" False)
  155. mark_as_advanced(FORCE_LEGACY_LIBBPF)
  156. if(ENABLE_ACLK OR ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  157. set(NEED_PROTOBUF True)
  158. else()
  159. set(NEED_PROTOBUF False)
  160. endif()
  161. if(ENABLE_PLUGIN_GO)
  162. include(NetdataGoTools)
  163. find_min_go_version("${CMAKE_SOURCE_DIR}/src/go")
  164. find_package(Go "${MIN_GO_VERSION}" REQUIRED)
  165. endif()
  166. if(ENABLE_PLUGIN_GO)
  167. set(NEED_NDSUDO TRUE)
  168. else()
  169. set(NEED_NDSUDO FALSE)
  170. endif()
  171. if(ENABLE_WEBRTC)
  172. include(FetchContent)
  173. include(NetdataFetchContentExtra)
  174. # ignore debhelper
  175. set(FETCHCONTENT_FULLY_DISCONNECTED Off)
  176. set(PREFER_SYSTEM_LIB True)
  177. set(NO_MEDIA True)
  178. set(NO_WEBSOCKET True)
  179. set(HAVE_LIBDATACHANNEL True)
  180. FetchContent_Declare(libdatachannel
  181. GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
  182. GIT_TAG v0.20.1
  183. CMAKE_ARGS ${NETDATA_PROPAGATE_TOOLCHAIN_ARGS}
  184. )
  185. FetchContent_MakeAvailable(libdatachannel)
  186. endif()
  187. if(NEED_PROTOBUF)
  188. include(NetdataProtobuf)
  189. if(ENABLE_BUNDLED_PROTOBUF)
  190. netdata_bundle_protobuf()
  191. endif()
  192. endif()
  193. set(PKG_FILES_PATH "${CMAKE_SOURCE_DIR}/packaging/cmake/pkg-files")
  194. if(ENABLE_PLUGIN_EBPF)
  195. include(NetdataLibBPF)
  196. include(NetdataEBPFCORE)
  197. if(NOT OS_LINUX)
  198. message(FATAL_ERROR "The eBPF plugin is not supported on non-Linux systems")
  199. endif()
  200. netdata_bundle_libbpf()
  201. netdata_fetch_ebpf_co_re()
  202. endif()
  203. #
  204. # Libm
  205. #
  206. # checks link with cmake required libs
  207. cmake_policy(SET CMP0075 NEW)
  208. include(CheckFunctionExists)
  209. check_function_exists(log10 HAVE_LOG10)
  210. if(NOT HAVE_LOG10)
  211. unset(HAVE_LOG10 CACHE)
  212. list(APPEND CMAKE_REQUIRED_LIBRARIES m)
  213. check_function_exists(log10 HAVE_LOG10)
  214. if(HAVE_LOG10)
  215. set(LINK_LIBM True)
  216. else()
  217. message(FATAL_ERROR "Can not use log10 with/without libm.")
  218. endif()
  219. endif()
  220. #
  221. # Custom Modules
  222. #
  223. include(NetdataJSONC)
  224. include(NetdataYAML)
  225. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  226. include(NetdataEBPFLegacy)
  227. endif()
  228. if(ENABLE_SENTRY)
  229. include(NetdataSentry)
  230. endif()
  231. #
  232. # Checks from custom modules
  233. #
  234. netdata_detect_jsonc()
  235. netdata_detect_libyaml()
  236. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  237. netdata_fetch_legacy_ebpf_code()
  238. endif()
  239. if(ENABLE_SENTRY)
  240. netdata_bundle_sentry()
  241. endif()
  242. #
  243. # check include files
  244. #
  245. include(CheckIncludeFile)
  246. check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
  247. check_include_file("resolv.h" HAVE_RESOLV_H)
  248. check_include_file("netdb.h" HAVE_NETDB_H)
  249. check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H)
  250. check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
  251. check_include_file("sys/vfs.h" HAVE_SYS_VFS_H)
  252. check_include_file("sys/statfs.h" HAVE_SYS_STATFS_H)
  253. check_include_file("linux/magic.h" HAVE_LINUX_MAGIC_H)
  254. check_include_file("sys/mount.h" HAVE_SYS_MOUNT_H)
  255. check_include_file("sys/statvfs.h" HAVE_SYS_STATVFS_H)
  256. check_include_file("inttypes.h" HAVE_INTTYPES_H)
  257. check_include_file("stdint.h" HAVE_STDINT_H)
  258. check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H)
  259. check_include_file("arpa/inet.h" HAVE_ARPA_INET_H)
  260. check_include_file("netinet/tcp.h" HAVE_NETINET_TCP_H)
  261. check_include_file("sys/ioctl.h" HAVE_SYS_IOCTL_H)
  262. check_include_file("grp.h" HAVE_GRP_H)
  263. check_include_file("pwd.h" HAVE_PWD_H)
  264. check_include_file("net/if.h" HAVE_NET_IF_H)
  265. check_include_file("poll.h" HAVE_POLL_H)
  266. check_include_file("syslog.h" HAVE_SYSLOG_H)
  267. check_include_file("sys/mman.h" HAVE_SYS_MMAN_H)
  268. check_include_file("sys/resource.h" HAVE_SYS_RESOURCE_H)
  269. check_include_file("sys/socket.h" HAVE_SYS_SOCKET_H)
  270. check_include_file("sys/wait.h" HAVE_SYS_WAIT_H)
  271. check_include_file("sys/un.h" HAVE_SYS_UN_H)
  272. check_include_file("spawn.h" HAVE_SPAWN_H)
  273. #
  274. # check symbols
  275. #
  276. include(CheckSymbolExists)
  277. check_symbol_exists(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
  278. check_symbol_exists(major "sys/mkdev.h" MAJOR_IN_MKDEV)
  279. check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
  280. check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
  281. check_symbol_exists(finite "math.h" HAVE_FINITE)
  282. check_symbol_exists(isfinite "math.h" HAVE_ISFINITE)
  283. check_symbol_exists(dlsym "dlfcn.h" HAVE_DLSYM)
  284. check_function_exists(pthread_getthreadid_np HAVE_PTHREAD_GETTHREADID_NP)
  285. check_function_exists(pthread_threadid_np HAVE_PTHREAD_THREADID_NP)
  286. check_function_exists(gettid HAVE_GETTID)
  287. check_function_exists(waitid HAVE_WAITID)
  288. check_function_exists(nice HAVE_NICE)
  289. check_function_exists(recvmmsg HAVE_RECVMMSG)
  290. check_function_exists(getpriority HAVE_GETPRIORITY)
  291. check_function_exists(setenv HAVE_SETENV)
  292. check_function_exists(strndup HAVE_STRNDUP)
  293. check_function_exists(sched_getscheduler HAVE_SCHED_GETSCHEDULER)
  294. check_function_exists(sched_setscheduler HAVE_SCHED_SETSCHEDULER)
  295. check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
  296. check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
  297. check_function_exists(close_range HAVE_CLOSE_RANGE)
  298. check_function_exists(backtrace HAVE_BACKTRACE)
  299. #
  300. # check source compilation
  301. #
  302. include(CheckCSourceCompiles)
  303. include(CheckCXXSourceCompiles)
  304. set(CMAKE_REQUIRED_LIBRARIES pthread)
  305. check_c_source_compiles("
  306. #define _GNU_SOURCE
  307. #include <pthread.h>
  308. int main() {
  309. char name[16];
  310. pthread_t thread = pthread_self();
  311. return pthread_getname_np(thread, name, sizeof(name));
  312. }
  313. " HAVE_PTHREAD_GETNAME_NP)
  314. check_c_source_compiles("
  315. #include <stdio.h>
  316. #define mytype(X) _Generic((X), int: 'i', float: 'f', default: 'u')
  317. int main() {
  318. char type = mytype(0);
  319. return 0;
  320. }
  321. " HAVE_C__GENERIC)
  322. check_c_source_compiles("
  323. #include <malloc.h>
  324. int main() {
  325. mallopt(M_ARENA_MAX, 1);
  326. mallopt(M_PERTURB, 0x5A);
  327. return 0;
  328. }
  329. " HAVE_C_MALLOPT)
  330. check_c_source_compiles("
  331. #define _GNU_SOURCE
  332. #include <stdio.h>
  333. #include <sys/socket.h>
  334. int main() {
  335. accept4(0, NULL, NULL, 0);
  336. return 0;
  337. }
  338. " HAVE_ACCEPT4)
  339. check_c_source_compiles("
  340. #define _GNU_SOURCE
  341. #include <string.h>
  342. int main() {
  343. char x = *strerror_r(0, &x, sizeof(x)); return 0;
  344. }
  345. " STRERROR_R_CHAR_P)
  346. check_c_source_compiles("
  347. #ifndef _GNU_SOURCE
  348. #define _GNU_SOURCE
  349. #endif
  350. #include <sched.h>
  351. int main() {
  352. setns(0, 0); return 0;
  353. }
  354. " HAVE_SETNS)
  355. check_cxx_source_compiles("
  356. int main() {
  357. __atomic_load_8(nullptr, 0);
  358. return 0;
  359. }
  360. " HAVE_BUILTIN_ATOMICS)
  361. check_c_source_compiles("
  362. void my_printf(char const *s, ...) __attribute__((format(gnu_printf, 1, 2)));
  363. int main() { return 0; }
  364. " HAVE_FUNC_ATTRIBUTE_FORMAT_GNU_PRINTF FAIL_REGEX "warning:")
  365. check_c_source_compiles("
  366. void my_printf(char const *s, ...) __attribute__((format(printf, 1, 2)));
  367. int main() { return 0; }
  368. " HAVE_FUNC_ATTRIBUTE_FORMAT_PRINTF FAIL_REGEX "warning:")
  369. check_c_source_compiles("
  370. #include <stdio.h>
  371. #include <stdlib.h>
  372. #include <unistd.h>
  373. void* my_alloc(size_t size) __attribute__((malloc));
  374. int main() {
  375. void *x = my_alloc(1);
  376. free(x);
  377. return 0;
  378. }
  379. void* my_alloc(size_t size) {
  380. void *ret = malloc(size);
  381. if(!ret) exit(1);
  382. return ret;
  383. }
  384. " HAVE_FUNC_ATTRIBUTE_MALLOC)
  385. check_c_source_compiles("
  386. void my_function() __attribute__((noinline));
  387. int main() { my_function(); return 0; }
  388. void my_function() { ; }
  389. " HAVE_FUNC_ATTRIBUTE_NOINLINE)
  390. check_c_source_compiles("
  391. void my_exit_function() __attribute__((noreturn));
  392. int main() {
  393. my_exit_function(); // Call the noreturn function
  394. return 0;
  395. }
  396. void my_exit_function() {
  397. exit(1);
  398. }
  399. " HAVE_FUNC_ATTRIBUTE_NORETURN)
  400. check_c_source_compiles("
  401. #include <stdio.h>
  402. #include <stdlib.h>
  403. #include <unistd.h>
  404. void* my_alloc(size_t size) __attribute__((returns_nonnull));
  405. int main() {
  406. void* ptr = my_alloc(10);
  407. free(ptr);
  408. return 0;
  409. }
  410. void* my_alloc(size_t size) {
  411. void *ret = malloc(size);
  412. if(!ret) exit(1);
  413. return ret;
  414. }
  415. " HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL)
  416. check_c_source_compiles("
  417. int my_function() __attribute__((warn_unused_result));
  418. int main() {
  419. return my_function();
  420. }
  421. int my_function() {
  422. return 1;
  423. }
  424. " HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT)
  425. if(OS_FREEBSD OR OS_MACOS)
  426. set(HAVE_BUILTIN_ATOMICS True)
  427. endif()
  428. # openssl/crypto
  429. set(ENABLE_OPENSSL True)
  430. pkg_check_modules(TLS IMPORTED_TARGET openssl)
  431. if(NOT TARGET PkgConfig::TLS)
  432. if(OS_MACOS)
  433. execute_process(COMMAND
  434. brew --prefix --installed openssl
  435. RESULT_VARIABLE BREW_OPENSSL
  436. OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
  437. OUTPUT_STRIP_TRAILING_WHITESPACE)
  438. if((BREW_OPENSSL NOT EQUAL 0) OR (NOT EXISTS "${BREW_OPENSSL_PREFIX}"))
  439. message(FATAL_ERROR "OpenSSL (or LibreSSL) is required for building Netdata, but could not be found.")
  440. endif()
  441. add_library(PkgConfig::CRYPTO IMPORTED)
  442. set_target_properties(PkgConfig::CRYPTO
  443. IMPORTED_LOCATION ${BREW_OPENSSL_PREFIX}/lib/libcrypto.dylib
  444. INTERFACE_INCLUDE_DIRECTORIES ${BREW_OPENSSL_PREFIX}/include)
  445. add_library(PkgConfig::TLS IMPORTED)
  446. set_target_properties(PkgConfig::TLS
  447. IMPORTED_LOCATION ${BREW_OPENSSL_PREFIX}/lib/libssl.dylib
  448. INTERFACE_LINK_LIBRARIES PkgConfig::CRYPTO
  449. INTERFACE_INCLUDE_DIRECTORIES ${BREW_OPENSSL_PREFIX}/include)
  450. else()
  451. message(FATAL_ERROR "OpenSSL (or LibreSSL) is required for building Netdata, but could not be found.")
  452. endif()
  453. else()
  454. pkg_check_modules(CRYPTO IMPORTED_TARGET REQUIRED libcrypto)
  455. endif()
  456. #
  457. # figure out if we need protoc/protobuf
  458. #
  459. if(NEED_PROTOBUF)
  460. netdata_detect_protobuf()
  461. endif()
  462. #
  463. # source files
  464. #
  465. set(LIBJUDY_PREV_FILES
  466. src/libnetdata/libjudy/src/JudyL/JudyLPrev.c
  467. src/libnetdata/libjudy/src/JudyL/JudyLPrevEmpty.c
  468. )
  469. set(LIBJUDY_NEXT_FILES
  470. src/libnetdata/libjudy/src/JudyL/JudyLNext.c
  471. src/libnetdata/libjudy/src/JudyL/JudyLNextEmpty.c
  472. )
  473. set(LIBJUDY_SOURCES
  474. src/libnetdata/libjudy/src/Judy.h
  475. src/libnetdata/libjudy/src/JudyCommon/JudyMalloc.c
  476. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate.h
  477. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate1L.h
  478. src/libnetdata/libjudy/src/JudyCommon/JudyPrivateBranch.h
  479. src/libnetdata/libjudy/src/JudyL/JudyL.h
  480. src/libnetdata/libjudy/src/JudyL/JudyLByCount.c
  481. src/libnetdata/libjudy/src/JudyL/JudyLCascade.c
  482. src/libnetdata/libjudy/src/JudyL/JudyLCount.c
  483. src/libnetdata/libjudy/src/JudyL/JudyLCreateBranch.c
  484. src/libnetdata/libjudy/src/JudyL/JudyLDecascade.c
  485. src/libnetdata/libjudy/src/JudyL/JudyLDel.c
  486. src/libnetdata/libjudy/src/JudyL/JudyLFirst.c
  487. src/libnetdata/libjudy/src/JudyL/JudyLFreeArray.c
  488. src/libnetdata/libjudy/src/JudyL/j__udyLGet.c
  489. src/libnetdata/libjudy/src/JudyL/JudyLGet.c
  490. src/libnetdata/libjudy/src/JudyL/JudyLInsArray.c
  491. src/libnetdata/libjudy/src/JudyL/JudyLIns.c
  492. src/libnetdata/libjudy/src/JudyL/JudyLInsertBranch.c
  493. src/libnetdata/libjudy/src/JudyL/JudyLMallocIF.c
  494. src/libnetdata/libjudy/src/JudyL/JudyLMemActive.c
  495. src/libnetdata/libjudy/src/JudyL/JudyLMemUsed.c
  496. src/libnetdata/libjudy/src/JudyL/JudyLTables.c
  497. src/libnetdata/libjudy/src/JudyHS/JudyHS.c
  498. ${LIBJUDY_PREV_FILES}
  499. ${LIBJUDY_NEXT_FILES}
  500. )
  501. set(LIBNETDATA_FILES
  502. ${CONFIG_H}
  503. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  504. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  505. src/libnetdata/config/appconfig.c
  506. src/libnetdata/config/appconfig.h
  507. src/libnetdata/aral/aral.c
  508. src/libnetdata/aral/aral.h
  509. src/libnetdata/avl/avl.c
  510. src/libnetdata/avl/avl.h
  511. src/libnetdata/buffer/buffer.c
  512. src/libnetdata/buffer/buffer.h
  513. src/libnetdata/circular_buffer/circular_buffer.c
  514. src/libnetdata/circular_buffer/circular_buffer.h
  515. src/libnetdata/clocks/clocks.c
  516. src/libnetdata/clocks/clocks.h
  517. src/libnetdata/completion/completion.c
  518. src/libnetdata/completion/completion.h
  519. src/libnetdata/datetime/iso8601.c
  520. src/libnetdata/datetime/iso8601.h
  521. src/libnetdata/datetime/rfc7231.c
  522. src/libnetdata/datetime/rfc7231.h
  523. src/libnetdata/datetime/rfc3339.c
  524. src/libnetdata/datetime/rfc3339.h
  525. src/libnetdata/dictionary/dictionary.c
  526. src/libnetdata/dictionary/dictionary.h
  527. src/libnetdata/eval/eval.c
  528. src/libnetdata/eval/eval.h
  529. src/libnetdata/facets/facets.c
  530. src/libnetdata/facets/facets.h
  531. src/libnetdata/functions_evloop/functions_evloop.c
  532. src/libnetdata/functions_evloop/functions_evloop.h
  533. src/libnetdata/gorilla/gorilla.cc
  534. src/libnetdata/gorilla/gorilla.h
  535. src/libnetdata/july/july.c
  536. src/libnetdata/july/july.h
  537. src/libnetdata/inlined.h
  538. src/libnetdata/json/json.c
  539. src/libnetdata/json/json.h
  540. src/libnetdata/json/jsmn.c
  541. src/libnetdata/json/jsmn.h
  542. src/libnetdata/libnetdata.c
  543. src/libnetdata/libnetdata.h
  544. src/libnetdata/line_splitter/line_splitter.c
  545. src/libnetdata/line_splitter/line_splitter.h
  546. src/libnetdata/libnetdata.h
  547. src/libnetdata/locks/locks.c
  548. src/libnetdata/locks/locks.h
  549. src/libnetdata/log/journal.c
  550. src/libnetdata/log/journal.h
  551. src/libnetdata/log/log.c
  552. src/libnetdata/log/log.h
  553. src/libnetdata/os/os.c
  554. src/libnetdata/os/os.h
  555. src/libnetdata/simple_hashtable.h
  556. src/libnetdata/os/byteorder.h
  557. src/libnetdata/onewayalloc/onewayalloc.c
  558. src/libnetdata/onewayalloc/onewayalloc.h
  559. src/libnetdata/procfile/procfile.c
  560. src/libnetdata/procfile/procfile.h
  561. src/libnetdata/query_progress/progress.c
  562. src/libnetdata/query_progress/progress.h
  563. src/libnetdata/required_dummies.h
  564. src/libnetdata/socket/security.c
  565. src/libnetdata/socket/security.h
  566. src/libnetdata/simple_pattern/simple_pattern.c
  567. src/libnetdata/simple_pattern/simple_pattern.h
  568. src/libnetdata/socket/socket.c
  569. src/libnetdata/socket/socket.h
  570. src/libnetdata/statistical/statistical.c
  571. src/libnetdata/statistical/statistical.h
  572. src/libnetdata/storage_number/storage_number.c
  573. src/libnetdata/storage_number/storage_number.h
  574. src/libnetdata/string/string.c
  575. src/libnetdata/string/string.h
  576. src/libnetdata/threads/threads.c
  577. src/libnetdata/threads/threads.h
  578. src/libnetdata/url/url.c
  579. src/libnetdata/url/url.h
  580. src/libnetdata/uuid/uuid.c
  581. src/libnetdata/uuid/uuid.h
  582. src/libnetdata/string/utf8.h
  583. src/libnetdata/worker_utilization/worker_utilization.c
  584. src/libnetdata/worker_utilization/worker_utilization.h
  585. src/libnetdata/http/http_access.c
  586. src/libnetdata/http/http_access.h
  587. src/libnetdata/http/http_defs.c
  588. src/libnetdata/http/http_defs.h
  589. src/libnetdata/http/content_type.c
  590. src/libnetdata/http/content_type.h
  591. src/libnetdata/config/dyncfg.c
  592. src/libnetdata/config/dyncfg.h
  593. src/libnetdata/json/json-c-parser-inline.h
  594. src/libnetdata/template-enum.h
  595. src/libnetdata/dictionary/dictionary-internals.h
  596. src/libnetdata/dictionary/dictionary-unittest.c
  597. src/libnetdata/dictionary/thread-cache.c
  598. src/libnetdata/dictionary/thread-cache.h
  599. src/libnetdata/dictionary/dictionary-traversal.c
  600. src/libnetdata/dictionary/dictionary-statistics.h
  601. src/libnetdata/dictionary/dictionary-locks.h
  602. src/libnetdata/dictionary/dictionary-refcount.h
  603. src/libnetdata/dictionary/dictionary-hashtable.h
  604. src/libnetdata/dictionary/dictionary-item.h
  605. src/libnetdata/dictionary/dictionary-callbacks.h
  606. src/libnetdata/linked-lists.h
  607. src/libnetdata/storage-point.h
  608. src/libnetdata/bitmap64.h
  609. src/libnetdata/os/gettid.c
  610. src/libnetdata/os/gettid.h
  611. src/libnetdata/os/adjtimex.c
  612. src/libnetdata/os/adjtimex.h
  613. src/libnetdata/os/setresuid.c
  614. src/libnetdata/os/setresuid.h
  615. src/libnetdata/os/setresgid.c
  616. src/libnetdata/os/setresgid.h
  617. src/libnetdata/os/getgrouplist.c
  618. src/libnetdata/os/getgrouplist.h
  619. src/libnetdata/os/get_pid_max.c
  620. src/libnetdata/os/get_pid_max.h
  621. src/libnetdata/os/os-freebsd-wrappers.c
  622. src/libnetdata/os/os-freebsd-wrappers.h
  623. src/libnetdata/os/os-macos-wrappers.c
  624. src/libnetdata/os/os-macos-wrappers.h
  625. src/libnetdata/os/os-windows-wrappers.c
  626. src/libnetdata/os/os-windows-wrappers.h
  627. src/libnetdata/os/get_system_cpus.c
  628. src/libnetdata/os/get_system_cpus.h
  629. src/libnetdata/os/tinysleep.c
  630. src/libnetdata/os/tinysleep.h
  631. src/libnetdata/os/uuid_generate.c
  632. src/libnetdata/os/uuid_generate.h
  633. src/libnetdata/os/setenv.c
  634. src/libnetdata/os/setenv.h
  635. src/libnetdata/os/strndup.c
  636. src/libnetdata/os/strndup.h
  637. src/libnetdata/spawn_server/spawn_server.c
  638. src/libnetdata/spawn_server/spawn_server.h
  639. src/libnetdata/spawn_server/spawn_popen.c
  640. src/libnetdata/spawn_server/spawn_popen.h
  641. src/libnetdata/os/close_range.c
  642. src/libnetdata/os/close_range.h
  643. src/libnetdata/os/setproctitle.c
  644. src/libnetdata/os/setproctitle.h
  645. )
  646. if(ENABLE_PLUGIN_EBPF)
  647. list(APPEND LIBNETDATA_FILES
  648. src/libnetdata/ebpf/ebpf.c
  649. src/libnetdata/ebpf/ebpf.h
  650. )
  651. endif()
  652. set(LIBH2O_FILES
  653. src/web/server/h2o/libh2o/deps/cloexec/cloexec.c
  654. src/web/server/h2o/libh2o/deps/libgkc/gkc.c
  655. src/web/server/h2o/libh2o/deps/libyrmcds/close.c
  656. src/web/server/h2o/libh2o/deps/libyrmcds/connect.c
  657. src/web/server/h2o/libh2o/deps/libyrmcds/recv.c
  658. src/web/server/h2o/libh2o/deps/libyrmcds/send.c
  659. src/web/server/h2o/libh2o/deps/libyrmcds/send_text.c
  660. src/web/server/h2o/libh2o/deps/libyrmcds/socket.c
  661. src/web/server/h2o/libh2o/deps/libyrmcds/strerror.c
  662. src/web/server/h2o/libh2o/deps/libyrmcds/text_mode.c
  663. src/web/server/h2o/libh2o/deps/picohttpparser/picohttpparser.c
  664. src/web/server/h2o/libh2o/lib/common/cache.c
  665. src/web/server/h2o/libh2o/lib/common/file.c
  666. src/web/server/h2o/libh2o/lib/common/filecache.c
  667. src/web/server/h2o/libh2o/lib/common/hostinfo.c
  668. src/web/server/h2o/libh2o/lib/common/http1client.c
  669. src/web/server/h2o/libh2o/lib/common/memcached.c
  670. src/web/server/h2o/libh2o/lib/common/memory.c
  671. src/web/server/h2o/libh2o/lib/common/multithread.c
  672. src/web/server/h2o/libh2o/lib/common/serverutil.c
  673. src/web/server/h2o/libh2o/lib/common/socket.c
  674. src/web/server/h2o/libh2o/lib/common/socketpool.c
  675. src/web/server/h2o/libh2o/lib/common/string.c
  676. src/web/server/h2o/libh2o/lib/common/time.c
  677. src/web/server/h2o/libh2o/lib/common/timeout.c
  678. src/web/server/h2o/libh2o/lib/common/url.c
  679. src/web/server/h2o/libh2o/lib/core/config.c
  680. src/web/server/h2o/libh2o/lib/core/configurator.c
  681. src/web/server/h2o/libh2o/lib/core/context.c
  682. src/web/server/h2o/libh2o/lib/core/headers.c
  683. src/web/server/h2o/libh2o/lib/core/logconf.c
  684. src/web/server/h2o/libh2o/lib/core/proxy.c
  685. src/web/server/h2o/libh2o/lib/core/request.c
  686. src/web/server/h2o/libh2o/lib/core/token.c
  687. src/web/server/h2o/libh2o/lib/core/util.c
  688. src/web/server/h2o/libh2o/lib/handler/access_log.c
  689. src/web/server/h2o/libh2o/lib/handler/chunked.c
  690. src/web/server/h2o/libh2o/lib/handler/compress.c
  691. src/web/server/h2o/libh2o/lib/handler/compress/gzip.c
  692. src/web/server/h2o/libh2o/lib/handler/errordoc.c
  693. src/web/server/h2o/libh2o/lib/handler/expires.c
  694. src/web/server/h2o/libh2o/lib/handler/fastcgi.c
  695. src/web/server/h2o/libh2o/lib/handler/file.c
  696. src/web/server/h2o/libh2o/lib/handler/headers.c
  697. src/web/server/h2o/libh2o/lib/handler/mimemap.c
  698. src/web/server/h2o/libh2o/lib/handler/proxy.c
  699. src/web/server/h2o/libh2o/lib/handler/redirect.c
  700. src/web/server/h2o/libh2o/lib/handler/reproxy.c
  701. src/web/server/h2o/libh2o/lib/handler/throttle_resp.c
  702. src/web/server/h2o/libh2o/lib/handler/status.c
  703. src/web/server/h2o/libh2o/lib/handler/headers_util.c
  704. src/web/server/h2o/libh2o/lib/handler/status/events.c
  705. src/web/server/h2o/libh2o/lib/handler/status/requests.c
  706. src/web/server/h2o/libh2o/lib/handler/http2_debug_state.c
  707. src/web/server/h2o/libh2o/lib/handler/status/durations.c
  708. src/web/server/h2o/libh2o/lib/handler/configurator/access_log.c
  709. src/web/server/h2o/libh2o/lib/handler/configurator/compress.c
  710. src/web/server/h2o/libh2o/lib/handler/configurator/errordoc.c
  711. src/web/server/h2o/libh2o/lib/handler/configurator/expires.c
  712. src/web/server/h2o/libh2o/lib/handler/configurator/fastcgi.c
  713. src/web/server/h2o/libh2o/lib/handler/configurator/file.c
  714. src/web/server/h2o/libh2o/lib/handler/configurator/headers.c
  715. src/web/server/h2o/libh2o/lib/handler/configurator/proxy.c
  716. src/web/server/h2o/libh2o/lib/handler/configurator/redirect.c
  717. src/web/server/h2o/libh2o/lib/handler/configurator/reproxy.c
  718. src/web/server/h2o/libh2o/lib/handler/configurator/throttle_resp.c
  719. src/web/server/h2o/libh2o/lib/handler/configurator/status.c
  720. src/web/server/h2o/libh2o/lib/handler/configurator/http2_debug_state.c
  721. src/web/server/h2o/libh2o/lib/handler/configurator/headers_util.c
  722. src/web/server/h2o/libh2o/lib/http1.c
  723. src/web/server/h2o/libh2o/lib/tunnel.c
  724. src/web/server/h2o/libh2o/lib/http2/cache_digests.c
  725. src/web/server/h2o/libh2o/lib/http2/casper.c
  726. src/web/server/h2o/libh2o/lib/http2/connection.c
  727. src/web/server/h2o/libh2o/lib/http2/frame.c
  728. src/web/server/h2o/libh2o/lib/http2/hpack.c
  729. src/web/server/h2o/libh2o/lib/http2/scheduler.c
  730. src/web/server/h2o/libh2o/lib/http2/stream.c
  731. src/web/server/h2o/libh2o/lib/http2/http2_debug_state.c
  732. )
  733. set(DAEMON_FILES
  734. src/daemon/buildinfo.c
  735. src/daemon/buildinfo.h
  736. src/daemon/common.c
  737. src/daemon/common.h
  738. src/daemon/daemon.c
  739. src/daemon/daemon.h
  740. src/daemon/event_loop.c
  741. src/daemon/event_loop.h
  742. src/daemon/global_statistics.c
  743. src/daemon/global_statistics.h
  744. src/daemon/analytics.c
  745. src/daemon/analytics.h
  746. src/daemon/main.c
  747. src/daemon/main.h
  748. src/daemon/win_system-info.c
  749. src/daemon/win_system-info.h
  750. src/daemon/signals.c
  751. src/daemon/signals.h
  752. src/daemon/service.c
  753. src/daemon/watcher.c
  754. src/daemon/watcher.h
  755. src/daemon/static_threads.c
  756. src/daemon/static_threads.h
  757. src/daemon/commands.c
  758. src/daemon/commands.h
  759. src/daemon/pipename.c
  760. src/daemon/pipename.h
  761. src/daemon/unit_test.c
  762. src/daemon/unit_test.h
  763. src/daemon/config/dyncfg.c
  764. src/daemon/config/dyncfg.h
  765. src/daemon/config/dyncfg-files.c
  766. src/daemon/config/dyncfg-unittest.c
  767. src/daemon/config/dyncfg-inline.c
  768. src/daemon/config/dyncfg-echo.c
  769. src/daemon/config/dyncfg-internals.h
  770. src/daemon/config/dyncfg-intercept.c
  771. src/daemon/config/dyncfg-tree.c
  772. )
  773. set(H2O_FILES
  774. src/web/server/h2o/http_server.c
  775. src/web/server/h2o/http_server.h
  776. src/web/server/h2o/h2o_utils.c
  777. src/web/server/h2o/h2o_utils.h
  778. src/web/server/h2o/streaming.c
  779. src/web/server/h2o/streaming.h
  780. src/web/server/h2o/connlist.c
  781. src/web/server/h2o/connlist.h
  782. )
  783. if(ENABLE_H2O)
  784. list(APPEND DAEMON_FILES ${H2O_FILES})
  785. endif()
  786. set(API_PLUGIN_FILES
  787. src/web/api/web_api.c
  788. src/web/api/web_api.h
  789. src/web/api/web_api_v1.c
  790. src/web/api/web_api_v1.h
  791. src/web/api/web_api_v2.c
  792. src/web/api/web_api_v2.h
  793. src/web/api/http_auth.c
  794. src/web/api/http_auth.h
  795. src/web/api/http_header.c
  796. src/web/api/http_header.h
  797. src/web/api/badges/web_buffer_svg.c
  798. src/web/api/badges/web_buffer_svg.h
  799. src/web/api/exporters/allmetrics.c
  800. src/web/api/exporters/allmetrics.h
  801. src/web/api/exporters/shell/allmetrics_shell.c
  802. src/web/api/exporters/shell/allmetrics_shell.h
  803. src/web/api/queries/rrdr.c
  804. src/web/api/queries/rrdr.h
  805. src/web/api/queries/query.c
  806. src/web/api/queries/query.h
  807. src/web/api/queries/average/average.c
  808. src/web/api/queries/average/average.h
  809. src/web/api/queries/countif/countif.c
  810. src/web/api/queries/countif/countif.h
  811. src/web/api/queries/incremental_sum/incremental_sum.c
  812. src/web/api/queries/incremental_sum/incremental_sum.h
  813. src/web/api/queries/max/max.c
  814. src/web/api/queries/max/max.h
  815. src/web/api/queries/min/min.c
  816. src/web/api/queries/min/min.h
  817. src/web/api/queries/sum/sum.c
  818. src/web/api/queries/sum/sum.h
  819. src/web/api/queries/median/median.c
  820. src/web/api/queries/median/median.h
  821. src/web/api/queries/percentile/percentile.c
  822. src/web/api/queries/percentile/percentile.h
  823. src/web/api/queries/stddev/stddev.c
  824. src/web/api/queries/stddev/stddev.h
  825. src/web/api/queries/ses/ses.c
  826. src/web/api/queries/ses/ses.h
  827. src/web/api/queries/des/des.c
  828. src/web/api/queries/des/des.h
  829. src/web/api/queries/trimmed_mean/trimmed_mean.c
  830. src/web/api/queries/trimmed_mean/trimmed_mean.h
  831. src/web/api/queries/weights.c
  832. src/web/api/queries/weights.h
  833. src/web/api/formatters/rrd2json.c
  834. src/web/api/formatters/rrd2json.h
  835. src/web/api/formatters/csv/csv.c
  836. src/web/api/formatters/csv/csv.h
  837. src/web/api/formatters/json/json.c
  838. src/web/api/formatters/json/json.h
  839. src/web/api/formatters/ssv/ssv.c
  840. src/web/api/formatters/ssv/ssv.h
  841. src/web/api/formatters/value/value.c
  842. src/web/api/formatters/value/value.h
  843. src/web/api/formatters/json_wrapper.c
  844. src/web/api/formatters/json_wrapper.h
  845. src/web/api/formatters/charts2json.c
  846. src/web/api/formatters/charts2json.h
  847. src/web/api/formatters/rrdset2json.c
  848. src/web/api/formatters/rrdset2json.h
  849. src/web/api/ilove/ilove.c
  850. src/web/api/ilove/ilove.h
  851. src/web/rtc/webrtc.c
  852. src/web/rtc/webrtc.h
  853. )
  854. set(EXPORTING_ENGINE_FILES
  855. src/exporting/exporting_engine.c
  856. src/exporting/exporting_engine.h
  857. src/exporting/graphite/graphite.c
  858. src/exporting/graphite/graphite.h
  859. src/exporting/json/json.c
  860. src/exporting/json/json.h
  861. src/exporting/opentsdb/opentsdb.c
  862. src/exporting/opentsdb/opentsdb.h
  863. src/exporting/prometheus/prometheus.c
  864. src/exporting/prometheus/prometheus.h
  865. src/exporting/read_config.c
  866. src/exporting/clean_connectors.c
  867. src/exporting/init_connectors.c
  868. src/exporting/process_data.c
  869. src/exporting/check_filters.c
  870. src/exporting/send_data.c
  871. src/exporting/send_internal_metrics.c
  872. )
  873. set(HEALTH_PLUGIN_FILES
  874. src/health/health.c
  875. src/health/health.h
  876. src/health/health_config.c
  877. src/health/health_json.c
  878. src/health/health_log.c
  879. src/health/health_prototypes.c
  880. src/health/health_prototypes.h
  881. src/health/health_silencers.c
  882. src/health/health_silencers.h
  883. src/health/health_internals.h
  884. src/health/health_notifications.c
  885. src/health/health_event_loop.c
  886. src/health/health_dyncfg.c
  887. src/health/health_variable.c
  888. src/health/rrdcalc.c
  889. src/health/rrdcalc.h
  890. src/health/rrdvar.c
  891. src/health/rrdvar.h
  892. )
  893. set(IDLEJITTER_PLUGIN_FILES src/collectors/idlejitter.plugin/plugin_idlejitter.c)
  894. if(ENABLE_ML)
  895. set(ML_FILES
  896. src/ml/ad_charts.h
  897. src/ml/ad_charts.cc
  898. src/ml/Config.cc
  899. src/ml/dlib/dlib/all/source.cpp
  900. src/ml/ml.h
  901. src/ml/ml.cc
  902. src/ml/ml-private.h
  903. )
  904. else()
  905. set(ML_FILES
  906. src/ml/ml.h
  907. src/ml/ml-dummy.c
  908. )
  909. endif()
  910. set(INTERNAL_COLLECTORS_FILES
  911. src/collectors/common-contexts/common-contexts.h
  912. src/collectors/common-contexts/disk.io.h
  913. src/collectors/common-contexts/system.io.h
  914. src/collectors/common-contexts/system.interrupts.h
  915. src/collectors/common-contexts/system.processes.h
  916. src/collectors/common-contexts/system.ram.h
  917. src/collectors/common-contexts/mem.swap.h
  918. src/collectors/common-contexts/mem.pgfaults.h
  919. src/collectors/common-contexts/mem.available.h
  920. )
  921. set(PLUGINSD_PLUGIN_FILES
  922. src/collectors/plugins.d/plugins_d.c
  923. src/collectors/plugins.d/plugins_d.h
  924. src/collectors/plugins.d/pluginsd_dyncfg.c
  925. src/collectors/plugins.d/pluginsd_dyncfg.h
  926. src/collectors/plugins.d/pluginsd_functions.c
  927. src/collectors/plugins.d/pluginsd_functions.h
  928. src/collectors/plugins.d/pluginsd_internals.c
  929. src/collectors/plugins.d/pluginsd_internals.h
  930. src/collectors/plugins.d/pluginsd_parser.c
  931. src/collectors/plugins.d/pluginsd_parser.h
  932. src/collectors/plugins.d/pluginsd_replication.c
  933. src/collectors/plugins.d/pluginsd_replication.h
  934. )
  935. set(RRD_PLUGIN_FILES
  936. src/database/contexts/api_v1.c
  937. src/database/contexts/api_v2.c
  938. src/database/contexts/context.c
  939. src/database/contexts/instance.c
  940. src/database/contexts/internal.h
  941. src/database/contexts/metric.c
  942. src/database/contexts/query_scope.c
  943. src/database/contexts/query_target.c
  944. src/database/contexts/rrdcontext.c
  945. src/database/contexts/rrdcontext.h
  946. src/database/contexts/worker.c
  947. src/database/rrdcollector.c
  948. src/database/rrdcollector.h
  949. src/database/rrddim.c
  950. src/database/rrdfunctions.c
  951. src/database/rrdfunctions.h
  952. src/database/rrdfunctions-inline.c
  953. src/database/rrdfunctions-inline.h
  954. src/database/rrdfunctions-progress.c
  955. src/database/rrdfunctions-progress.h
  956. src/database/rrdfunctions-streaming.c
  957. src/database/rrdfunctions-streaming.h
  958. src/database/rrdhost.c
  959. src/database/rrdlabels.c
  960. src/database/rrd.c
  961. src/database/rrd.h
  962. src/database/rrdset.c
  963. src/database/storage_engine.c
  964. src/database/storage_engine.h
  965. src/database/ram/rrddim_mem.c
  966. src/database/ram/rrddim_mem.h
  967. src/database/sqlite/sqlite_metadata.c
  968. src/database/sqlite/sqlite_metadata.h
  969. src/database/sqlite/sqlite_functions.c
  970. src/database/sqlite/sqlite_functions.h
  971. src/database/sqlite/sqlite_context.c
  972. src/database/sqlite/sqlite_context.h
  973. src/database/sqlite/sqlite_db_migration.c
  974. src/database/sqlite/sqlite_db_migration.h
  975. src/database/sqlite/sqlite_aclk.c
  976. src/database/sqlite/sqlite_aclk.h
  977. src/database/sqlite/sqlite_health.c
  978. src/database/sqlite/sqlite_health.h
  979. src/database/sqlite/sqlite_aclk_node.c
  980. src/database/sqlite/sqlite_aclk_node.h
  981. src/database/sqlite/sqlite_aclk_alert.c
  982. src/database/sqlite/sqlite_aclk_alert.h
  983. src/database/sqlite/sqlite3.c
  984. src/database/sqlite/sqlite3.h
  985. src/database/sqlite/sqlite3recover.c
  986. src/database/sqlite/sqlite3recover.h
  987. src/database/sqlite/dbdata.c
  988. src/database/KolmogorovSmirnovDist.c
  989. src/database/KolmogorovSmirnovDist.h
  990. src/database/rrdfunctions-inflight.c
  991. src/database/rrdfunctions-inflight.h
  992. src/database/rrdfunctions-exporters.c
  993. src/database/rrdfunctions-exporters.h
  994. src/database/rrdfunctions-internals.h
  995. src/database/rrdcollector-internals.h
  996. )
  997. if(ENABLE_DBENGINE)
  998. list(APPEND RRD_PLUGIN_FILES
  999. src/database/engine/rrdengine.c
  1000. src/database/engine/rrdengine.h
  1001. src/database/engine/rrddiskprotocol.h
  1002. src/database/engine/datafile.c
  1003. src/database/engine/datafile.h
  1004. src/database/engine/journalfile.c
  1005. src/database/engine/journalfile.h
  1006. src/database/engine/rrdenginelib.c
  1007. src/database/engine/rrdenginelib.h
  1008. src/database/engine/rrdengineapi.c
  1009. src/database/engine/rrdengineapi.h
  1010. src/database/engine/pagecache.c
  1011. src/database/engine/pagecache.h
  1012. src/database/engine/page_test.cc
  1013. src/database/engine/page.c
  1014. src/database/engine/page.h
  1015. src/database/engine/cache.c
  1016. src/database/engine/cache.h
  1017. src/database/engine/metric.c
  1018. src/database/engine/metric.h
  1019. src/database/engine/pdc.c
  1020. src/database/engine/pdc.h
  1021. src/database/engine/dbengine-unittest.c
  1022. src/database/engine/dbengine-stresstest.c
  1023. src/database/engine/dbengine-compression.c
  1024. src/database/engine/dbengine-compression.h
  1025. )
  1026. endif()
  1027. set(REGISTRY_PLUGIN_FILES
  1028. src/registry/registry.c
  1029. src/registry/registry.h
  1030. src/registry/registry_db.c
  1031. src/registry/registry_init.c
  1032. src/registry/registry_internals.c
  1033. src/registry/registry_internals.h
  1034. src/registry/registry_log.c
  1035. src/registry/registry_machine.c
  1036. src/registry/registry_machine.h
  1037. src/registry/registry_person.c
  1038. src/registry/registry_person.h
  1039. )
  1040. set(STATSD_PLUGIN_FILES
  1041. src/collectors/statsd.plugin/statsd.c
  1042. )
  1043. set(SYSTEMD_JOURNAL_PLUGIN_FILES
  1044. src/collectors/systemd-journal.plugin/systemd-journal.c
  1045. src/collectors/systemd-journal.plugin/systemd-internals.h
  1046. src/collectors/systemd-journal.plugin/systemd-main.c
  1047. src/collectors/systemd-journal.plugin/systemd-units.c
  1048. src/collectors/systemd-journal.plugin/systemd-journal.c
  1049. src/collectors/systemd-journal.plugin/systemd-journal-annotations.c
  1050. src/collectors/systemd-journal.plugin/systemd-journal-files.c
  1051. src/collectors/systemd-journal.plugin/systemd-journal-fstat.c
  1052. src/collectors/systemd-journal.plugin/systemd-journal-watcher.c
  1053. src/collectors/systemd-journal.plugin/systemd-journal-dyncfg.c
  1054. src/libnetdata/maps/system-users.h
  1055. src/libnetdata/maps/system-groups.h
  1056. src/libnetdata/maps/system-services.h
  1057. )
  1058. set(STREAMING_PLUGIN_FILES
  1059. src/streaming/rrdpush.c
  1060. src/streaming/rrdpush.h
  1061. src/streaming/compression.c
  1062. src/streaming/compression.h
  1063. src/streaming/compression_brotli.c
  1064. src/streaming/compression_brotli.h
  1065. src/streaming/compression_gzip.c
  1066. src/streaming/compression_gzip.h
  1067. src/streaming/compression_lz4.c
  1068. src/streaming/compression_lz4.h
  1069. src/streaming/compression_zstd.c
  1070. src/streaming/compression_zstd.h
  1071. src/streaming/receiver.c
  1072. src/streaming/sender.c
  1073. src/streaming/replication.c
  1074. src/streaming/replication.h
  1075. src/streaming/common.h
  1076. )
  1077. set(WEB_PLUGIN_FILES
  1078. src/web/server/web_client.c
  1079. src/web/server/web_client.h
  1080. src/web/server/web_server.c
  1081. src/web/server/web_server.h
  1082. src/web/server/static/static-threaded.c
  1083. src/web/server/static/static-threaded.h
  1084. src/web/server/web_client_cache.c
  1085. src/web/server/web_client_cache.h
  1086. )
  1087. set(CLAIM_PLUGIN_FILES
  1088. src/claim/claim.c
  1089. src/claim/claim.h
  1090. )
  1091. set(ACLK_ALWAYS_BUILD
  1092. src/aclk/aclk_rrdhost_state.h
  1093. src/aclk/aclk_proxy.c
  1094. src/aclk/aclk_proxy.h
  1095. src/aclk/aclk.c
  1096. src/aclk/aclk.h
  1097. src/aclk/aclk_capas.c
  1098. src/aclk/aclk_capas.h
  1099. src/aclk/aclk_util.c
  1100. src/aclk/aclk_util.h
  1101. src/aclk/https_client.c
  1102. src/aclk/https_client.h
  1103. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.c
  1104. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.h
  1105. src/aclk/mqtt_websockets/c-rbuf/cringbuffer_internal.h
  1106. src/aclk/mqtt_websockets/c_rhash/c_rhash.c
  1107. src/aclk/mqtt_websockets/c_rhash/c_rhash.h
  1108. src/aclk/mqtt_websockets/c_rhash/c_rhash_internal.h
  1109. )
  1110. set(TIMEX_PLUGIN_FILES
  1111. src/collectors/timex.plugin/plugin_timex.c
  1112. )
  1113. set(PROFILE_PLUGIN_FILES
  1114. src/collectors/profile.plugin/plugin_profile.cc
  1115. )
  1116. set(CGROUPS_PLUGIN_FILES
  1117. src/collectors/cgroups.plugin/sys_fs_cgroup.c
  1118. src/collectors/cgroups.plugin/sys_fs_cgroup.h
  1119. src/collectors/cgroups.plugin/cgroup-internals.h
  1120. src/collectors/cgroups.plugin/cgroup-discovery.c
  1121. src/collectors/cgroups.plugin/cgroup-charts.c
  1122. src/collectors/cgroups.plugin/cgroup-top.c
  1123. )
  1124. set(DISKSPACE_PLUGIN_FILES
  1125. src/collectors/diskspace.plugin/plugin_diskspace.c
  1126. )
  1127. set(MACOS_PLUGIN_FILES
  1128. src/collectors/macos.plugin/plugin_macos.c
  1129. src/collectors/macos.plugin/plugin_macos.h
  1130. src/collectors/macos.plugin/macos_sysctl.c
  1131. src/collectors/macos.plugin/macos_mach_smi.c
  1132. src/collectors/macos.plugin/macos_fw.c
  1133. )
  1134. set(FREEBSD_PLUGIN_FILES
  1135. src/collectors/freebsd.plugin/plugin_freebsd.c
  1136. src/collectors/freebsd.plugin/plugin_freebsd.h
  1137. src/collectors/freebsd.plugin/freebsd_sysctl.c
  1138. src/collectors/freebsd.plugin/freebsd_getmntinfo.c
  1139. src/collectors/freebsd.plugin/freebsd_getifaddrs.c
  1140. src/collectors/freebsd.plugin/freebsd_devstat.c
  1141. src/collectors/freebsd.plugin/freebsd_kstat_zfs.c
  1142. src/collectors/freebsd.plugin/freebsd_ipfw.c
  1143. src/collectors/proc.plugin/zfs_common.c
  1144. src/collectors/proc.plugin/zfs_common.h
  1145. )
  1146. set(WINDOWS_PLUGIN_FILES
  1147. src/collectors/windows.plugin/windows_plugin.c
  1148. src/collectors/windows.plugin/windows_plugin.h
  1149. src/collectors/windows.plugin/GetSystemUptime.c
  1150. src/collectors/windows.plugin/GetSystemRAM.c
  1151. src/collectors/windows.plugin/GetSystemCPU.c
  1152. src/collectors/windows.plugin/perflib.c
  1153. src/collectors/windows.plugin/perflib.h
  1154. src/collectors/windows.plugin/perflib-rrd.c
  1155. src/collectors/windows.plugin/perflib-rrd.h
  1156. src/collectors/windows.plugin/perflib-names.c
  1157. src/collectors/windows.plugin/perflib-dump.c
  1158. src/collectors/windows.plugin/perflib-storage.c
  1159. src/collectors/windows.plugin/perflib-processor.c
  1160. src/collectors/windows.plugin/perflib-objects.c
  1161. src/collectors/windows.plugin/perflib-network.c
  1162. src/collectors/windows.plugin/perflib-memory.c
  1163. src/collectors/windows.plugin/perflib-processes.c
  1164. )
  1165. set(PROC_PLUGIN_FILES
  1166. src/collectors/proc.plugin/ipc.c
  1167. src/collectors/proc.plugin/plugin_proc.c
  1168. src/collectors/proc.plugin/plugin_proc.h
  1169. src/collectors/proc.plugin/proc_sys_fs_file_nr.c
  1170. src/collectors/proc.plugin/proc_diskstats.c
  1171. src/collectors/proc.plugin/proc_mdstat.c
  1172. src/collectors/proc.plugin/proc_interrupts.c
  1173. src/collectors/proc.plugin/proc_softirqs.c
  1174. src/collectors/proc.plugin/proc_loadavg.c
  1175. src/collectors/proc.plugin/proc_meminfo.c
  1176. src/collectors/proc.plugin/proc_pagetypeinfo.c
  1177. src/collectors/proc.plugin/proc_net_dev.c
  1178. src/collectors/proc.plugin/proc_net_dev_renames.c
  1179. src/collectors/proc.plugin/proc_net_dev_renames.h
  1180. src/collectors/proc.plugin/proc_net_wireless.c
  1181. src/collectors/proc.plugin/proc_net_ip_vs_stats.c
  1182. src/collectors/proc.plugin/proc_net_netstat.c
  1183. src/collectors/proc.plugin/proc_net_rpc_nfs.c
  1184. src/collectors/proc.plugin/proc_net_rpc_nfsd.c
  1185. src/collectors/proc.plugin/proc_net_sctp_snmp.c
  1186. src/collectors/proc.plugin/proc_net_sockstat.c
  1187. src/collectors/proc.plugin/proc_net_sockstat6.c
  1188. src/collectors/proc.plugin/proc_net_softnet_stat.c
  1189. src/collectors/proc.plugin/proc_net_stat_conntrack.c
  1190. src/collectors/proc.plugin/proc_net_stat_synproxy.c
  1191. src/collectors/proc.plugin/proc_self_mountinfo.c
  1192. src/collectors/proc.plugin/proc_self_mountinfo.h
  1193. src/collectors/proc.plugin/zfs_common.c
  1194. src/collectors/proc.plugin/zfs_common.h
  1195. src/collectors/proc.plugin/proc_spl_kstat_zfs.c
  1196. src/collectors/proc.plugin/proc_stat.c
  1197. src/collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  1198. src/collectors/proc.plugin/proc_vmstat.c
  1199. src/collectors/proc.plugin/proc_uptime.c
  1200. src/collectors/proc.plugin/proc_pressure.c
  1201. src/collectors/proc.plugin/proc_pressure.h
  1202. src/collectors/proc.plugin/sys_kernel_mm_ksm.c
  1203. src/collectors/proc.plugin/sys_block_zram.c
  1204. src/collectors/proc.plugin/sys_devices_system_edac_mc.c
  1205. src/collectors/proc.plugin/sys_devices_system_node.c
  1206. src/collectors/proc.plugin/sys_class_infiniband.c
  1207. src/collectors/proc.plugin/sys_fs_btrfs.c
  1208. src/collectors/proc.plugin/sys_class_power_supply.c
  1209. src/collectors/proc.plugin/sys_devices_pci_aer.c
  1210. src/collectors/proc.plugin/sys_class_drm.c
  1211. )
  1212. set(TC_PLUGIN_FILES
  1213. src/collectors/tc.plugin/plugin_tc.c
  1214. )
  1215. set(NETDATA_FILES
  1216. src/collectors/all.h
  1217. ${DAEMON_FILES}
  1218. ${API_PLUGIN_FILES}
  1219. ${EXPORTING_ENGINE_FILES}
  1220. ${HEALTH_PLUGIN_FILES}
  1221. ${IDLEJITTER_PLUGIN_FILES}
  1222. ${ML_FILES}
  1223. ${PLUGINSD_PLUGIN_FILES}
  1224. ${RRD_PLUGIN_FILES}
  1225. ${REGISTRY_PLUGIN_FILES}
  1226. ${STATSD_PLUGIN_FILES}
  1227. ${STREAMING_PLUGIN_FILES}
  1228. ${WEB_PLUGIN_FILES}
  1229. ${CLAIM_PLUGIN_FILES}
  1230. ${ACLK_ALWAYS_BUILD}
  1231. ${PROFILE_PLUGIN_FILES}
  1232. )
  1233. if(OS_LINUX)
  1234. list(APPEND NETDATA_FILES
  1235. src/daemon/static_threads_linux.c
  1236. ${CGROUPS_PLUGIN_FILES}
  1237. ${DISKSPACE_PLUGIN_FILES}
  1238. ${PROC_PLUGIN_FILES}
  1239. ${TC_PLUGIN_FILES}
  1240. ${TIMEX_PLUGIN_FILES}
  1241. ${INTERNAL_COLLECTORS_FILES}
  1242. )
  1243. if(ENABLE_SENTRY)
  1244. list(APPEND NETDATA_FILES
  1245. src/daemon/sentry-native/sentry-native.c
  1246. src/daemon/sentry-native/sentry-native.h)
  1247. endif()
  1248. elseif(OS_MACOS)
  1249. list(APPEND NETDATA_FILES
  1250. src/daemon/static_threads_macos.c
  1251. ${MACOS_PLUGIN_FILES}
  1252. ${TIMEX_PLUGIN_FILES}
  1253. ${INTERNAL_COLLECTORS_FILES}
  1254. )
  1255. elseif(OS_FREEBSD)
  1256. list(APPEND NETDATA_FILES
  1257. src/daemon/static_threads_freebsd.c
  1258. ${FREEBSD_PLUGIN_FILES}
  1259. ${TIMEX_PLUGIN_FILES}
  1260. ${INTERNAL_COLLECTORS_FILES}
  1261. )
  1262. elseif(OS_WINDOWS)
  1263. list(APPEND NETDATA_FILES
  1264. src/daemon/static_threads_windows.c
  1265. src/daemon/winsvc.cc
  1266. ${WINDOWS_PLUGIN_FILES}
  1267. ${INTERNAL_COLLECTORS_FILES}
  1268. )
  1269. endif()
  1270. set(MQTT_WEBSOCKETS_FILES
  1271. src/aclk/mqtt_websockets/mqtt_wss_client.c
  1272. src/aclk/mqtt_websockets/mqtt_wss_client.h
  1273. src/aclk/mqtt_websockets/mqtt_wss_log.c
  1274. src/aclk/mqtt_websockets/mqtt_wss_log.h
  1275. src/aclk/mqtt_websockets/ws_client.c
  1276. src/aclk/mqtt_websockets/ws_client.h
  1277. src/aclk/mqtt_websockets/mqtt_ng.c
  1278. src/aclk/mqtt_websockets/mqtt_ng.h
  1279. src/aclk/mqtt_websockets/common_public.c
  1280. src/aclk/mqtt_websockets/common_public.h
  1281. src/aclk/mqtt_websockets/common_internal.h
  1282. )
  1283. set(ACLK_PROTO_DEFS
  1284. src/aclk/aclk-schemas/proto/aclk/v1/lib.proto
  1285. src/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
  1286. src/aclk/aclk-schemas/proto/agent/v1/connection.proto
  1287. src/aclk/aclk-schemas/proto/alarm/v1/config.proto
  1288. src/aclk/aclk-schemas/proto/alarm/v1/stream.proto
  1289. src/aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.proto
  1290. src/aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto
  1291. src/aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto
  1292. src/aclk/aclk-schemas/proto/context/v1/context.proto
  1293. src/aclk/aclk-schemas/proto/context/v1/stream.proto
  1294. src/aclk/aclk-schemas/proto/agent/v1/cmds.proto
  1295. )
  1296. set(ACLK_FILES
  1297. src/aclk/aclk_stats.c
  1298. src/aclk/aclk_stats.h
  1299. src/aclk/aclk_query.c
  1300. src/aclk/aclk_query.h
  1301. src/aclk/aclk_query_queue.c
  1302. src/aclk/aclk_query_queue.h
  1303. src/aclk/aclk_otp.c
  1304. src/aclk/aclk_otp.h
  1305. src/aclk/aclk_tx_msgs.c
  1306. src/aclk/aclk_tx_msgs.h
  1307. src/aclk/aclk_rx_msgs.c
  1308. src/aclk/aclk_rx_msgs.h
  1309. src/aclk/aclk_alarm_api.c
  1310. src/aclk/aclk_alarm_api.h
  1311. src/aclk/aclk_contexts_api.c
  1312. src/aclk/aclk_contexts_api.h
  1313. src/aclk/schema-wrappers/connection.cc
  1314. src/aclk/schema-wrappers/connection.h
  1315. src/aclk/schema-wrappers/node_connection.cc
  1316. src/aclk/schema-wrappers/node_connection.h
  1317. src/aclk/schema-wrappers/node_creation.cc
  1318. src/aclk/schema-wrappers/node_creation.h
  1319. src/aclk/schema-wrappers/alarm_stream.cc
  1320. src/aclk/schema-wrappers/alarm_stream.h
  1321. src/aclk/schema-wrappers/alarm_config.cc
  1322. src/aclk/schema-wrappers/alarm_config.h
  1323. src/aclk/schema-wrappers/node_info.cc
  1324. src/aclk/schema-wrappers/node_info.h
  1325. src/aclk/schema-wrappers/capability.cc
  1326. src/aclk/schema-wrappers/capability.h
  1327. src/aclk/schema-wrappers/proto_2_json.cc
  1328. src/aclk/schema-wrappers/proto_2_json.h
  1329. src/aclk/schema-wrappers/context_stream.cc
  1330. src/aclk/schema-wrappers/context_stream.h
  1331. src/aclk/schema-wrappers/context.cc
  1332. src/aclk/schema-wrappers/context.h
  1333. src/aclk/schema-wrappers/schema_wrappers.h
  1334. src/aclk/schema-wrappers/schema_wrapper_utils.cc
  1335. src/aclk/schema-wrappers/schema_wrapper_utils.h
  1336. src/aclk/schema-wrappers/agent_cmds.cc
  1337. src/aclk/schema-wrappers/agent_cmds.h
  1338. src/aclk/helpers/mqtt_wss_pal.h
  1339. src/aclk/helpers/ringbuffer_pal.h
  1340. )
  1341. set(MONGODB_EXPORTING_FILES
  1342. src/exporting/mongodb/mongodb.c
  1343. src/exporting/mongodb/mongodb.h
  1344. )
  1345. set(PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1346. src/exporting/prometheus/remote_write/remote_write.c
  1347. src/exporting/prometheus/remote_write/remote_write.h
  1348. src/exporting/prometheus/remote_write/remote_write_request.cc
  1349. src/exporting/prometheus/remote_write/remote_write_request.h
  1350. )
  1351. #
  1352. # build h2o
  1353. #
  1354. if(ENABLE_H2O)
  1355. add_library(h2o STATIC ${LIBH2O_FILES})
  1356. target_include_directories(h2o BEFORE PUBLIC
  1357. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include"
  1358. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/cloexec"
  1359. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/brotli/enc"
  1360. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/golombset"
  1361. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libgkc"
  1362. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libyrmcds"
  1363. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/klib"
  1364. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/neverbleed"
  1365. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picohttpparser"
  1366. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picotest"
  1367. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yaml/include"
  1368. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yoml"
  1369. )
  1370. target_compile_options(h2o PRIVATE
  1371. -Wno-all -Wno-extra
  1372. -Wno-shadow
  1373. -Wno-deprecated-declarations
  1374. -Wformat
  1375. )
  1376. target_compile_options(h2o PUBLIC -DH2O_USE_LIBUV=0)
  1377. target_link_libraries(h2o PRIVATE PkgConfig::TLS)
  1378. endif()
  1379. #
  1380. # build libjudy
  1381. #
  1382. add_library(judy STATIC ${LIBJUDY_SOURCES})
  1383. target_compile_options(judy PRIVATE
  1384. -Wno-all -Wno-extra
  1385. -Wno-shadow
  1386. -Wformat
  1387. )
  1388. target_compile_definitions(judy PRIVATE
  1389. JUDYL
  1390. $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:JU_64BIT>
  1391. )
  1392. target_include_directories(judy PUBLIC
  1393. src/libnetdata/libjudy/src
  1394. src/libnetdata/libjudy/src/JudyCommon
  1395. )
  1396. set_source_files_properties(${LIBJUDY_PREV_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYPREV")
  1397. set_source_files_properties(${LIBJUDY_NEXT_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYNEXT")
  1398. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/j__udyLGet.c PROPERTIES COMPILE_OPTIONS "-DJUDYGETINLINE")
  1399. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/JudyLByCount.c PROPERTIES COMPILE_OPTIONS "-DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB")
  1400. set_source_files_properties(JudyLTables.c PROPERTIES COMPILE_OPTIONS "-I${CMAKE_SOURCE_DIR}/src/libnetdata/libjudy/src/JudyL")
  1401. #
  1402. # build libnetdata
  1403. #
  1404. if(OS_LINUX)
  1405. include(NetdataDetectSystemd)
  1406. detect_systemd()
  1407. endif()
  1408. add_library(libnetdata STATIC ${LIBNETDATA_FILES})
  1409. target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src)
  1410. # pthread (FIXME: use find_package for this)
  1411. # set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  1412. # set(THREADS_PREFER_PTHREAD_FLAG TRUE)
  1413. # find_package(Threads REQUIRED)
  1414. # add_executable(test test.cpp)
  1415. # target_link_libraries(test Threads::Threads)
  1416. target_link_libraries(libnetdata PUBLIC
  1417. "$<$<NOT:$<BOOL:${HAVE_BUILTIN_ATOMICS}>>:atomic>"
  1418. "$<$<OR:$<BOOL:${OS_LINUX}>,$<BOOL:${OS_FREEBSD}>>:pthread;rt>"
  1419. "$<$<BOOL:${OS_WINDOWS}>:kernel32;advapi32;winmm;rpcrt4>"
  1420. "$<$<BOOL:${LINK_LIBM}>:m>"
  1421. "${SYSTEMD_LDFLAGS}")
  1422. # ebpf
  1423. if(ENABLE_PLUGIN_EBPF)
  1424. netdata_add_libbpf_to_target(libnetdata)
  1425. endif()
  1426. # judy
  1427. target_link_libraries(libnetdata PUBLIC judy)
  1428. netdata_add_jsonc_to_target(libnetdata)
  1429. netdata_add_libyaml_to_target(libnetdata)
  1430. # zlib
  1431. if(OS_MACOS)
  1432. find_package(ZLIB REQUIRED)
  1433. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  1434. target_link_libraries(libnetdata PUBLIC ZLIB::ZLIB)
  1435. else()
  1436. pkg_check_modules(ZLIB REQUIRED zlib)
  1437. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  1438. target_compile_options(libnetdata PUBLIC ${ZLIB_CFLAGS_OTHER})
  1439. target_link_libraries(libnetdata PUBLIC ${ZLIB_LDFLAGS})
  1440. endif()
  1441. # lz4 - try to find a version that is compatible with streaming compression
  1442. # otherwise pick whichever one we can find to support dbengine but don't set
  1443. # ENABLE_LZ4.
  1444. pkg_check_modules(LIBLZ4 liblz4>=1.9.0)
  1445. if(LIBLZ4_FOUND)
  1446. set(ENABLE_LZ4 On)
  1447. else()
  1448. pkg_check_modules(LIBLZ4 REQUIRED liblz4)
  1449. endif()
  1450. target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
  1451. target_compile_options(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
  1452. target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
  1453. # zstd
  1454. pkg_check_modules(LIBZSTD libzstd)
  1455. if(LIBZSTD_FOUND)
  1456. set(ENABLE_ZSTD On)
  1457. target_include_directories(libnetdata BEFORE PUBLIC ${LIBZSTD_INCLUDE_DIRS})
  1458. target_compile_options(libnetdata PUBLIC ${LIBZSTD_CFLAGS_OTHER})
  1459. target_link_libraries(libnetdata PUBLIC ${LIBZSTD_LDFLAGS})
  1460. endif()
  1461. # brotli
  1462. pkg_check_modules(LIBBROTLI libbrotlidec libbrotlienc libbrotlicommon)
  1463. if(LIBBROTLI_FOUND)
  1464. set(ENABLE_BROTLI On)
  1465. target_include_directories(libnetdata PUBLIC ${LIBBROTLI_INCLUDE_DIRS})
  1466. target_compile_options(libnetdata PUBLIC ${LIBBROTLI_CFLAGS_OTHER})
  1467. target_link_libraries(libnetdata PUBLIC ${LIBBROTLI_LDFLAGS})
  1468. endif()
  1469. # uuid
  1470. if(OS_MACOS OR OS_WINDOWS)
  1471. # UUID functionality is part of the system libraries here, so no extra
  1472. # stuff needed.
  1473. else()
  1474. pkg_check_modules(UUID REQUIRED uuid)
  1475. target_include_directories(libnetdata BEFORE PUBLIC ${UUID_INCLUDE_DIRS})
  1476. target_compile_options(libnetdata PUBLIC ${UUID_CFLAGS_OTHER})
  1477. target_link_libraries(libnetdata PUBLIC ${UUID_LDFLAGS})
  1478. endif()
  1479. # uv
  1480. pkg_check_modules(LIBUV REQUIRED libuv)
  1481. target_include_directories(libnetdata BEFORE PUBLIC ${LIBUV_INCLUDE_DIRS})
  1482. target_compile_options(libnetdata PUBLIC ${LIBUV_CFLAGS_OTHER})
  1483. target_link_libraries(libnetdata PUBLIC ${LIBUV_LDFLAGS})
  1484. # crypto
  1485. target_link_libraries(libnetdata PUBLIC PkgConfig::CRYPTO)
  1486. # openssl
  1487. target_link_libraries(libnetdata PUBLIC PkgConfig::TLS)
  1488. # mnl
  1489. if(NOT OS_MACOS)
  1490. pkg_check_modules(MNL libmnl)
  1491. if(MNL_FOUND)
  1492. set(HAVE_LIBMNL True)
  1493. endif()
  1494. endif()
  1495. #
  1496. # mqtt library
  1497. #
  1498. if (ENABLE_H2O OR ENABLE_ACLK)
  1499. set(ENABLE_MQTTWEBSOCKETS True)
  1500. endif()
  1501. if(ENABLE_MQTTWEBSOCKETS)
  1502. add_library(mqttwebsockets STATIC ${MQTT_WEBSOCKETS_FILES})
  1503. target_compile_options(mqttwebsockets PUBLIC -DMQTT_WSS_CUSTOM_ALLOC
  1504. -DRBUF_CUSTOM_MALLOC
  1505. -DMQTT_WSS_CPUSTATS)
  1506. target_include_directories(mqttwebsockets PUBLIC ${CMAKE_SOURCE_DIR}/aclk/helpers
  1507. ${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include)
  1508. target_link_libraries(mqttwebsockets PRIVATE libnetdata)
  1509. endif()
  1510. if(ENABLE_ACLK)
  1511. #
  1512. # proto definitions
  1513. #
  1514. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1515. "${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1516. ACLK_PROTO_BUILT_SRCS
  1517. ACLK_PROTO_BUILT_HDRS
  1518. ${ACLK_PROTO_DEFS})
  1519. list(APPEND ACLK_FILES ${ACLK_PROTO_BUILT_SRCS}
  1520. ${ACLK_PROTO_BUILT_HDRS})
  1521. endif()
  1522. #
  1523. # build plugins
  1524. #
  1525. if(ENABLE_PLUGIN_DEBUGFS)
  1526. pkg_check_modules(CAP QUIET libcap)
  1527. set(DEBUGFS_PLUGIN_FILES src/collectors/debugfs.plugin/debugfs_plugin.c
  1528. src/collectors/debugfs.plugin/debugfs_plugin.h
  1529. src/collectors/debugfs.plugin/debugfs_extfrag.c
  1530. src/collectors/debugfs.plugin/debugfs_zswap.c
  1531. src/collectors/debugfs.plugin/sys_devices_virtual_powercap.c)
  1532. add_executable(debugfs.plugin ${DEBUGFS_PLUGIN_FILES})
  1533. target_link_libraries(debugfs.plugin libnetdata ${CAP_LIBRARIES})
  1534. target_include_directories(debugfs.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1535. target_compile_options(debugfs.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1536. install(TARGETS debugfs.plugin
  1537. COMPONENT plugin-debugfs
  1538. DESTINATION usr/libexec/netdata/plugins.d)
  1539. if(BUILD_FOR_PACKAGING)
  1540. install(FILES
  1541. ${PKG_FILES_PATH}/copyright
  1542. COMPONENT plugin-debugfs
  1543. DESTINATION usr/share/doc/netdata-plugin-debugfs)
  1544. endif()
  1545. endif()
  1546. if(ENABLE_PLUGIN_APPS)
  1547. pkg_check_modules(CAP QUIET libcap)
  1548. set(APPS_PLUGIN_FILES
  1549. src/collectors/apps.plugin/apps_plugin.c
  1550. src/collectors/apps.plugin/apps_plugin.h
  1551. src/collectors/apps.plugin/apps_functions.c
  1552. src/collectors/apps.plugin/apps_targets.c
  1553. src/collectors/apps.plugin/apps_users_and_groups.c
  1554. src/collectors/apps.plugin/apps_output.c
  1555. src/collectors/apps.plugin/apps_proc_pid_status.c
  1556. src/collectors/apps.plugin/apps_proc_pid_limits.c
  1557. src/collectors/apps.plugin/apps_proc_pid_stat.c
  1558. src/collectors/apps.plugin/apps_proc_pid_cmdline.c
  1559. src/collectors/apps.plugin/apps_proc_pid_io.c
  1560. src/collectors/apps.plugin/apps_proc_stat.c
  1561. src/collectors/apps.plugin/apps_proc_pid_fd.c
  1562. src/collectors/apps.plugin/apps_proc_pids.c
  1563. src/collectors/apps.plugin/apps_proc_meminfo.c
  1564. )
  1565. add_executable(apps.plugin ${APPS_PLUGIN_FILES})
  1566. target_link_libraries(apps.plugin libnetdata ${CAP_LIBRARIES})
  1567. target_include_directories(apps.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1568. target_compile_options(apps.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1569. install(TARGETS apps.plugin
  1570. COMPONENT plugin-apps
  1571. DESTINATION usr/libexec/netdata/plugins.d)
  1572. install(FILES src/collectors/apps.plugin/apps_groups.conf
  1573. COMPONENT plugin-apps
  1574. DESTINATION usr/lib/netdata/conf.d)
  1575. if(BUILD_FOR_PACKAGING)
  1576. install(FILES
  1577. ${PKG_FILES_PATH}/copyright
  1578. COMPONENT plugin-apps
  1579. DESTINATION usr/share/doc/netdata-plugin-apps)
  1580. endif()
  1581. endif()
  1582. if(CAP_FOUND)
  1583. set(HAVE_CAPABILITY True)
  1584. endif()
  1585. if(ENABLE_PLUGIN_FREEIPMI)
  1586. pkg_check_modules(IPMI REQUIRED libipmimonitoring)
  1587. set(FREEIPMI_PLUGIN_FILES src/collectors/freeipmi.plugin/freeipmi_plugin.c)
  1588. add_executable(freeipmi.plugin ${FREEIPMI_PLUGIN_FILES})
  1589. target_link_libraries (freeipmi.plugin libnetdata ${IPMI_LIBRARIES})
  1590. target_include_directories(freeipmi.plugin PRIVATE ${IPMI_INCLUDE_DIRS})
  1591. target_compile_options(freeipmi.plugin PRIVATE ${IPMI_CFLAGS_OTHER})
  1592. install(TARGETS freeipmi.plugin
  1593. COMPONENT plugin-freeipmi
  1594. DESTINATION usr/libexec/netdata/plugins.d)
  1595. if(BUILD_FOR_PACKAGING)
  1596. install(FILES
  1597. ${PKG_FILES_PATH}/copyright
  1598. COMPONENT plugin-freeipmi
  1599. DESTINATION usr/share/doc/netdata-plugin-freeipmi)
  1600. endif()
  1601. endif()
  1602. if(ENABLE_PLUGIN_NFACCT)
  1603. if (NOT MNL_FOUND)
  1604. message(FATAL_ERROR "Can not build nfacct.plugin because MNL library could not be found.")
  1605. endif()
  1606. pkg_check_modules(NFACCT REQUIRED libnetfilter_acct)
  1607. set(NFACCT_PLUGIN_FILES src/collectors/nfacct.plugin/plugin_nfacct.c)
  1608. add_executable(nfacct.plugin ${NFACCT_PLUGIN_FILES})
  1609. target_link_libraries (nfacct.plugin libnetdata ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  1610. target_include_directories(nfacct.plugin PRIVATE ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  1611. target_compile_options(nfacct.plugin PRIVATE ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  1612. install(TARGETS nfacct.plugin
  1613. COMPONENT plugin-nfacct
  1614. DESTINATION usr/libexec/netdata/plugins.d)
  1615. if(BUILD_FOR_PACKAGING)
  1616. install(FILES
  1617. ${PKG_FILES_PATH}/copyright
  1618. COMPONENT plugin-nfacct
  1619. DESTINATION usr/share/doc/netdata-plugin-nfacct)
  1620. endif()
  1621. endif()
  1622. if(ENABLE_PLUGIN_XENSTAT)
  1623. pkg_check_modules(XENSTAT REQUIRED xenstat)
  1624. pkg_check_modules(XENLIGHT REQUIRED xenlight)
  1625. set(XENSTAT_PLUGIN_FILES src/collectors/xenstat.plugin/xenstat_plugin.c)
  1626. add_executable(xenstat.plugin ${XENSTAT_PLUGIN_FILES})
  1627. target_link_libraries (xenstat.plugin libnetdata ${XENLIGHT_LIBRARIES} ${XENSTAT_LIBRARIES})
  1628. target_include_directories(xenstat.plugin PRIVATE ${XENLIGHT_INCLUDE_DIRS} ${XENSTAT_INCLUDE_DIRS})
  1629. target_compile_options(xenstat.plugin PRIVATE ${XENLIGHT_CFLAGS_OTHER} ${XENSTAT_CFLAGS_OTHER})
  1630. install(TARGETS xenstat.plugin
  1631. COMPONENT plugin-xenstat
  1632. DESTINATION usr/libexec/netdata/plugins.d)
  1633. if(BUILD_FOR_PACKAGING)
  1634. install(FILES
  1635. ${PKG_FILES_PATH}/copyright
  1636. COMPONENT plugin-xenstat
  1637. DESTINATION usr/share/doc/netdata-plugin-xenstat)
  1638. endif()
  1639. endif()
  1640. if(ENABLE_PLUGIN_PERF)
  1641. set(PERF_PLUGIN_FILES src/collectors/perf.plugin/perf_plugin.c)
  1642. add_executable(perf.plugin ${PERF_PLUGIN_FILES})
  1643. target_link_libraries(perf.plugin libnetdata)
  1644. install(TARGETS perf.plugin
  1645. COMPONENT plugin-perf
  1646. DESTINATION usr/libexec/netdata/plugins.d)
  1647. if(BUILD_FOR_PACKAGING)
  1648. install(FILES
  1649. ${PKG_FILES_PATH}/copyright
  1650. COMPONENT plugin-perf
  1651. DESTINATION usr/share/doc/netdata-plugin-perf)
  1652. endif()
  1653. endif()
  1654. if(ENABLE_PLUGIN_SLABINFO)
  1655. set(SLABINFO_PLUGIN_FILES src/collectors/slabinfo.plugin/slabinfo.c)
  1656. add_executable(slabinfo.plugin ${SLABINFO_PLUGIN_FILES})
  1657. target_link_libraries(slabinfo.plugin libnetdata)
  1658. install(TARGETS slabinfo.plugin
  1659. COMPONENT plugin-slabinfo
  1660. DESTINATION usr/libexec/netdata/plugins.d)
  1661. if(BUILD_FOR_PACKAGING)
  1662. install(FILES
  1663. ${PKG_FILES_PATH}/copyright
  1664. COMPONENT plugin-slabinfo
  1665. DESTINATION usr/share/doc/netdata-plugin-slabinfo)
  1666. endif()
  1667. endif()
  1668. if(ENABLE_PLUGIN_CUPS)
  1669. pkg_check_modules(CUPS libcups)
  1670. if(NOT CUPS_FOUND)
  1671. pkg_check_modules(CUPS cups)
  1672. if(NOT CUPS_FOUND)
  1673. find_program(CUPS_CONFIG cups-config)
  1674. if(CUPS_CONFIG)
  1675. execute_process(COMMAND ${CUPS_CONFIG} --api-version OUTPUT_VARIABLE CUPS_API_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
  1676. if(CUPS_API_VERSION VERSION_LESS "1.7")
  1677. set(CUPS_FOUND False)
  1678. else()
  1679. execute_process(COMMAND ${CUPS_CONFIG} --cflags OUTPUT_VARIABLE CUPS_CFLAGS_OTHER OUTPUT_STRIP_TRAILING_WHITESPACE)
  1680. execute_process(COMMAND ${CUPS_CONFIG} --libs OUTPUT_VARIABLE CUPS_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
  1681. set(CUPS_FOUND True)
  1682. endif()
  1683. endif()
  1684. endif()
  1685. endif()
  1686. if(NOT CUPS_FOUND)
  1687. message(WARNING "Could not find cups cflags and libs.")
  1688. else()
  1689. set(CUPS_PLUGIN_FILES src/collectors/cups.plugin/cups_plugin.c)
  1690. add_executable(cups.plugin ${CUPS_PLUGIN_FILES})
  1691. target_link_libraries (cups.plugin libnetdata ${CUPS_LIBRARIES})
  1692. target_compile_options(cups.plugin PRIVATE ${CUPS_CFLAGS_OTHER})
  1693. install(TARGETS cups.plugin
  1694. COMPONENT plugin-cups
  1695. DESTINATION usr/libexec/netdata/plugins.d)
  1696. if(BUILD_FOR_PACKAGING)
  1697. install(FILES
  1698. ${PKG_FILES_PATH}/copyright
  1699. COMPONENT plugin-cups
  1700. DESTINATION usr/share/doc/netdata-plugin-cups)
  1701. endif()
  1702. endif()
  1703. endif()
  1704. if(NEED_NDSUDO)
  1705. set(NDSUDO_FILES src/collectors/plugins.d/ndsudo.c)
  1706. add_executable(ndsudo ${NDSUDO_FILES})
  1707. install(TARGETS ndsudo
  1708. COMPONENT netdata
  1709. DESTINATION usr/libexec/netdata/plugins.d)
  1710. endif()
  1711. if(ENABLE_PLUGIN_CGROUP_NETWORK)
  1712. set(CGROUP_NETWORK_FILES src/collectors/cgroups.plugin/cgroup-network.c)
  1713. add_executable(cgroup-network ${CGROUP_NETWORK_FILES})
  1714. target_link_libraries(cgroup-network libnetdata)
  1715. install(TARGETS cgroup-network
  1716. COMPONENT netdata
  1717. DESTINATION usr/libexec/netdata/plugins.d)
  1718. endif()
  1719. if(ENABLE_PLUGIN_SYSTEMD_JOURNAL)
  1720. if(NOT SYSTEMD_FOUND)
  1721. message(FATAL_ERROR "Systemd journal plugin requires systemd, but systemd was not found.")
  1722. endif()
  1723. add_executable(systemd-journal.plugin ${SYSTEMD_JOURNAL_PLUGIN_FILES})
  1724. target_link_libraries(systemd-journal.plugin libnetdata)
  1725. install(TARGETS systemd-journal.plugin
  1726. COMPONENT plugin-systemd-journal
  1727. DESTINATION usr/libexec/netdata/plugins.d)
  1728. if(BUILD_FOR_PACKAGING)
  1729. install(FILES
  1730. ${PKG_FILES_PATH}/copyright
  1731. COMPONENT plugin-systemd-journal
  1732. DESTINATION usr/share/doc/netdata-plugin-systemd-journal)
  1733. endif()
  1734. endif()
  1735. if(ENABLE_PLUGIN_EBPF)
  1736. set(EBPF_PLUGIN_FILES
  1737. src/collectors/ebpf.plugin/ebpf.c
  1738. src/collectors/ebpf.plugin/ebpf.h
  1739. src/collectors/ebpf.plugin/ebpf_cachestat.c
  1740. src/collectors/ebpf.plugin/ebpf_cachestat.h
  1741. src/collectors/ebpf.plugin/ebpf_dcstat.c
  1742. src/collectors/ebpf.plugin/ebpf_dcstat.h
  1743. src/collectors/ebpf.plugin/ebpf_disk.c
  1744. src/collectors/ebpf.plugin/ebpf_disk.h
  1745. src/collectors/ebpf.plugin/ebpf_fd.c
  1746. src/collectors/ebpf.plugin/ebpf_fd.h
  1747. src/collectors/ebpf.plugin/ebpf_hardirq.c
  1748. src/collectors/ebpf.plugin/ebpf_hardirq.h
  1749. src/collectors/ebpf.plugin/ebpf_mdflush.c
  1750. src/collectors/ebpf.plugin/ebpf_mdflush.h
  1751. src/collectors/ebpf.plugin/ebpf_mount.c
  1752. src/collectors/ebpf.plugin/ebpf_mount.h
  1753. src/collectors/ebpf.plugin/ebpf_filesystem.c
  1754. src/collectors/ebpf.plugin/ebpf_filesystem.h
  1755. src/collectors/ebpf.plugin/ebpf_oomkill.c
  1756. src/collectors/ebpf.plugin/ebpf_oomkill.h
  1757. src/collectors/ebpf.plugin/ebpf_process.c
  1758. src/collectors/ebpf.plugin/ebpf_process.h
  1759. src/collectors/ebpf.plugin/ebpf_shm.c
  1760. src/collectors/ebpf.plugin/ebpf_shm.h
  1761. src/collectors/ebpf.plugin/ebpf_socket.c
  1762. src/collectors/ebpf.plugin/ebpf_socket.h
  1763. src/collectors/ebpf.plugin/ebpf_softirq.c
  1764. src/collectors/ebpf.plugin/ebpf_softirq.h
  1765. src/collectors/ebpf.plugin/ebpf_sync.c
  1766. src/collectors/ebpf.plugin/ebpf_sync.h
  1767. src/collectors/ebpf.plugin/ebpf_swap.c
  1768. src/collectors/ebpf.plugin/ebpf_swap.h
  1769. src/collectors/ebpf.plugin/ebpf_vfs.c
  1770. src/collectors/ebpf.plugin/ebpf_vfs.h
  1771. src/collectors/ebpf.plugin/ebpf_apps.c
  1772. src/collectors/ebpf.plugin/ebpf_apps.h
  1773. src/collectors/ebpf.plugin/ebpf_cgroup.c
  1774. src/collectors/ebpf.plugin/ebpf_cgroup.h
  1775. src/collectors/ebpf.plugin/ebpf_unittest.c
  1776. src/collectors/ebpf.plugin/ebpf_unittest.h
  1777. src/collectors/ebpf.plugin/ebpf_functions.c
  1778. src/collectors/ebpf.plugin/ebpf_functions.h
  1779. )
  1780. add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
  1781. target_link_libraries(ebpf.plugin libnetdata)
  1782. netdata_add_ebpf_co_re_to_target(ebpf.plugin)
  1783. install(TARGETS ebpf.plugin
  1784. COMPONENT plugin-ebpf
  1785. DESTINATION usr/libexec/netdata/plugins.d)
  1786. install(FILES
  1787. src/collectors/ebpf.plugin/ebpf.d.conf
  1788. COMPONENT plugin-ebpf
  1789. DESTINATION usr/lib/netdata/conf.d)
  1790. install(FILES
  1791. src/collectors/ebpf.plugin/ebpf.d/cachestat.conf
  1792. src/collectors/ebpf.plugin/ebpf.d/dcstat.conf
  1793. src/collectors/ebpf.plugin/ebpf.d/disk.conf
  1794. src/collectors/ebpf.plugin/ebpf.d/ebpf_kernel_reject_list.txt
  1795. src/collectors/ebpf.plugin/ebpf.d/fd.conf
  1796. src/collectors/ebpf.plugin/ebpf.d/filesystem.conf
  1797. src/collectors/ebpf.plugin/ebpf.d/hardirq.conf
  1798. src/collectors/ebpf.plugin/ebpf.d/mdflush.conf
  1799. src/collectors/ebpf.plugin/ebpf.d/mount.conf
  1800. src/collectors/ebpf.plugin/ebpf.d/network.conf
  1801. src/collectors/ebpf.plugin/ebpf.d/oomkill.conf
  1802. src/collectors/ebpf.plugin/ebpf.d/process.conf
  1803. src/collectors/ebpf.plugin/ebpf.d/shm.conf
  1804. src/collectors/ebpf.plugin/ebpf.d/softirq.conf
  1805. src/collectors/ebpf.plugin/ebpf.d/swap.conf
  1806. src/collectors/ebpf.plugin/ebpf.d/sync.conf
  1807. src/collectors/ebpf.plugin/ebpf.d/vfs.conf
  1808. COMPONENT plugin-ebpf
  1809. DESTINATION usr/lib/netdata/conf.d/ebpf.d)
  1810. if(BUILD_FOR_PACKAGING)
  1811. install(FILES
  1812. ${PKG_FILES_PATH}/copyright
  1813. COMPONENT plugin-ebpf
  1814. DESTINATION usr/share/doc/netdata-plugin-ebpf)
  1815. endif()
  1816. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  1817. netdata_install_legacy_ebpf_code()
  1818. endif()
  1819. endif()
  1820. if(ENABLE_PLUGIN_LOCAL_LISTENERS)
  1821. set(LOCAL_LISTENERS_FILES
  1822. src/collectors/plugins.d/local_listeners.c
  1823. src/libnetdata/maps/local-sockets.h
  1824. )
  1825. add_executable(local-listeners ${LOCAL_LISTENERS_FILES})
  1826. target_compile_options(local-listeners PRIVATE
  1827. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1828. target_include_directories(local-listeners PRIVATE
  1829. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1830. target_link_libraries(local-listeners libnetdata
  1831. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1832. install(TARGETS local-listeners
  1833. COMPONENT netdata
  1834. DESTINATION usr/libexec/netdata/plugins.d)
  1835. endif()
  1836. if(ENABLE_PLUGIN_NETWORK_VIEWER)
  1837. set(NETWORK_VIEWER_FILES
  1838. src/libnetdata/maps/local-sockets.h
  1839. src/libnetdata/maps/system-users.h
  1840. src/collectors/network-viewer.plugin/network-viewer.c
  1841. )
  1842. add_executable(network-viewer.plugin ${NETWORK_VIEWER_FILES})
  1843. target_compile_options(network-viewer.plugin PRIVATE
  1844. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1845. target_include_directories(network-viewer.plugin PRIVATE
  1846. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1847. target_link_libraries(network-viewer.plugin libnetdata
  1848. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1849. install(TARGETS network-viewer.plugin
  1850. COMPONENT plugin-network-viewer
  1851. DESTINATION usr/libexec/netdata/plugins.d)
  1852. if(BUILD_FOR_PACKAGING)
  1853. install(FILES
  1854. ${PKG_FILES_PATH}/copyright
  1855. COMPONENT plugin-network-viewer
  1856. DESTINATION usr/share/doc/netdata-plugin-network-viewer)
  1857. endif()
  1858. endif()
  1859. #
  1860. # exporters
  1861. #
  1862. if(ENABLE_EXPORTER_MONGODB)
  1863. pkg_check_modules(MONGOC libmongoc-1.0>=1.7)
  1864. if(MONGOC_FOUND)
  1865. SET(HAVE_MONGOC True)
  1866. else()
  1867. SET(ENABLE_EXPORTER_MONGODB False)
  1868. endif()
  1869. endif()
  1870. if(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  1871. pkg_check_modules(SNAPPY snappy)
  1872. if (NOT SNAPPY_FOUND)
  1873. include(CheckLibraryExists)
  1874. check_library_exists(snappy snappy_compress "" HAVE_SNAPPY_LIB)
  1875. if(HAVE_SNAPPY_LIB)
  1876. set(SNAPPY_INCLUDE_DIRS "")
  1877. set(SNAPPY_CFLAGS_OTHER "")
  1878. set(SNAPPY_LIBRARIES "-lsnappy")
  1879. else()
  1880. message(FATAL_ERROR "Could not find snappy libraries with pkg-config or internal cmake checks.")
  1881. endif()
  1882. endif()
  1883. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1884. "${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1885. PROMETHEUS_REMOTE_WRITE_BUILT_SRCS
  1886. PROMETHEUS_REMOTE_WRITE_BUILT_HDRS
  1887. "src/exporting/prometheus/remote_write/remote_write.proto")
  1888. list(APPEND PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1889. ${PROMETHEUS_REMOTE_WRITE_BUILT_SRCS}
  1890. ${PROMETHEUS_REMOTE_WRITE_BUILT_HDRS})
  1891. set(ENABLE_PROMETHEUS_REMOTE_WRITE True)
  1892. endif()
  1893. #
  1894. # build netdata (only Linux ATM)
  1895. #
  1896. add_executable(netdata
  1897. ${NETDATA_FILES}
  1898. "$<$<BOOL:${ENABLE_ACLK}>:${ACLK_FILES}>"
  1899. "$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
  1900. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
  1901. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
  1902. )
  1903. target_compile_definitions(netdata PRIVATE
  1904. "$<$<BOOL:${ENABLE_ML}>:DLIB_NO_GUI_SUPPORT>"
  1905. )
  1906. target_compile_options(netdata PRIVATE
  1907. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_CFLAGS_OTHER}>"
  1908. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_CFLAGS_OTHER}>"
  1909. )
  1910. target_include_directories(netdata PRIVATE
  1911. "$<$<BOOL:${ENABLE_ACLK}>:${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas>"
  1912. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_INCLUDE_DIRS}>"
  1913. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_INCLUDE_DIRS}>"
  1914. )
  1915. target_link_libraries(netdata PRIVATE
  1916. m
  1917. libnetdata
  1918. "$<$<BOOL:${OS_LINUX}>:rt>"
  1919. "$<$<BOOL:${ENABLE_MQTTWEBSOCKETS}>:mqttwebsockets>"
  1920. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_LIBRARIES}>"
  1921. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_LIBRARIES}>"
  1922. "$<$<BOOL:${OS_MACOS}>:${IOKIT};${FOUNDATION}>"
  1923. "$<$<BOOL:${ENABLE_SENTRY}>:sentry>"
  1924. "$<$<BOOL:${ENABLE_WEBRTC}>:LibDataChannel::LibDataChannelStatic>"
  1925. "$<$<BOOL:${ENABLE_H2O}>:h2o>"
  1926. )
  1927. if(NEED_PROTOBUF)
  1928. netdata_add_protobuf(netdata)
  1929. endif()
  1930. #
  1931. # build systemd-cat-native
  1932. #
  1933. set(SYSTEMD_CAT_NATIVE_FILES src/libnetdata/log/systemd-cat-native.c
  1934. src/libnetdata/log/systemd-cat-native.h)
  1935. add_executable(systemd-cat-native ${SYSTEMD_CAT_NATIVE_FILES})
  1936. target_link_libraries(systemd-cat-native libnetdata)
  1937. install(TARGETS systemd-cat-native
  1938. COMPONENT netdata
  1939. DESTINATION "${BINDIR}")
  1940. #
  1941. # build log2journal
  1942. #
  1943. pkg_check_modules(PCRE2 libpcre2-8)
  1944. if(PCRE2_FOUND)
  1945. set(LOG2JOURNAL_FILES
  1946. ${CONFIG_H}
  1947. src/collectors/log2journal/log2journal.h
  1948. src/collectors/log2journal/log2journal.c
  1949. src/collectors/log2journal/log2journal-help.c
  1950. src/collectors/log2journal/log2journal-yaml.c
  1951. src/collectors/log2journal/log2journal-json.c
  1952. src/collectors/log2journal/log2journal-logfmt.c
  1953. src/collectors/log2journal/log2journal-pcre2.c
  1954. src/collectors/log2journal/log2journal-params.c
  1955. src/collectors/log2journal/log2journal-inject.c
  1956. src/collectors/log2journal/log2journal-pattern.c
  1957. src/collectors/log2journal/log2journal-replace.c
  1958. src/collectors/log2journal/log2journal-rename.c
  1959. src/collectors/log2journal/log2journal-rewrite.c
  1960. )
  1961. add_executable(log2journal ${LOG2JOURNAL_FILES})
  1962. target_include_directories(log2journal BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src ${PCRE2_INCLUDE_DIRS})
  1963. target_compile_options(log2journal PUBLIC ${PCRE2_CFLAGS_OTHER})
  1964. target_link_libraries(log2journal PUBLIC "${PCRE2_LDFLAGS}")
  1965. netdata_add_libyaml_to_target(log2journal)
  1966. install(TARGETS log2journal
  1967. COMPONENT netdata
  1968. DESTINATION "${BINDIR}")
  1969. install(DIRECTORY src/collectors/log2journal/log2journal.d
  1970. COMPONENT netdata
  1971. DESTINATION usr/lib/netdata/conf.d)
  1972. endif()
  1973. #
  1974. # build netdatacli
  1975. #
  1976. set(NETDATACLI_FILES
  1977. src/daemon/commands.h
  1978. src/daemon/pipename.c
  1979. src/daemon/pipename.h
  1980. src/cli/cli.c
  1981. )
  1982. add_executable(netdatacli ${NETDATACLI_FILES})
  1983. target_link_libraries(netdatacli libnetdata)
  1984. install(TARGETS netdatacli
  1985. COMPONENT netdata
  1986. DESTINATION "${BINDIR}")
  1987. #
  1988. # Build go.d.plugin
  1989. #
  1990. if(ENABLE_PLUGIN_GO)
  1991. add_go_target(go-plugin go.d.plugin src/go cmd/godplugin)
  1992. install(PROGRAMS ${CMAKE_BINARY_DIR}/go.d.plugin
  1993. COMPONENT plugin-go
  1994. DESTINATION usr/libexec/netdata/plugins.d)
  1995. endif()
  1996. #
  1997. # Generate config file
  1998. #
  1999. if(NOT NETDATA_RUNTIME_PREFIX STREQUAL "")
  2000. string(REGEX REPLACE "/$" "" NETDATA_RUNTIME_PREFIX "${NETDATA_RUNTIME_PREFIX}")
  2001. endif()
  2002. set(CACHE_DIR "${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")
  2003. set(CONFIG_DIR "${NETDATA_RUNTIME_PREFIX}/etc/netdata")
  2004. set(LIBCONFIG_DIR "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")
  2005. set(LOG_DIR "${NETDATA_RUNTIME_PREFIX}/var/log/netdata")
  2006. set(PLUGINS_DIR "${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata/plugins.d")
  2007. set(VARLIB_DIR "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")
  2008. # A non-default value is only used when building Debian packages (/var/lib/netdata/www)
  2009. if(NOT DEFINED WEB_DIR)
  2010. set(WEB_DIR "usr/share/netdata/web")
  2011. else()
  2012. string(REGEX REPLACE "^/" "" WEB_DIR "${WEB_DIR}")
  2013. endif()
  2014. set(WEB_DEST "${WEB_DIR}")
  2015. set(WEB_DIR "${NETDATA_RUNTIME_PREFIX}/${WEB_DEST}")
  2016. set(CONFIGURE_COMMAND "dummy-configure-command")
  2017. if (NOT NETDATA_USER)
  2018. set(NETDATA_USER "netdata")
  2019. endif()
  2020. configure_file(packaging/cmake/config.cmake.h.in config.h)
  2021. #
  2022. # install
  2023. #
  2024. install(TARGETS netdata COMPONENT netdata DESTINATION "${BINDIR}")
  2025. install(DIRECTORY COMPONENT netdata DESTINATION var/cache/netdata)
  2026. install(DIRECTORY COMPONENT netdata DESTINATION var/log/netdata)
  2027. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/registry)
  2028. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/cloud.d)
  2029. install(DIRECTORY COMPONENT netdata DESTINATION var/run/netdata)
  2030. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata)
  2031. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/custom-plugins.d)
  2032. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/go.d)
  2033. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/health.d)
  2034. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/python.d)
  2035. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/ssl)
  2036. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/statsd.d)
  2037. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d)
  2038. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d/schema.d)
  2039. install(DIRECTORY COMPONENT netdata DESTINATION usr/libexec/netdata/plugins.d)
  2040. install(DIRECTORY COMPONENT netdata DESTINATION ${WEB_DEST})
  2041. set(libsysdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/system")
  2042. set(pkglibexecdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata")
  2043. set(localstatedir_POST "${NETDATA_RUNTIME_PREFIX}/var")
  2044. set(sbindir_POST "${NETDATA_RUNTIME_PREFIX}/${BINDIR}")
  2045. set(configdir_POST "${NETDATA_RUNTIME_PREFIX}/etc/netdata")
  2046. set(libconfigdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")
  2047. set(cachedir_POST "${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")
  2048. set(registrydir_POST "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata/registry")
  2049. set(varlibdir_POST "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")
  2050. set(netdata_user_POST "${NETDATA_USER}")
  2051. # netdata-claim.sh
  2052. if(ENABLE_CLOUD)
  2053. set(enable_cloud_POST "yes")
  2054. else()
  2055. set(enable_cloud_POST "no")
  2056. endif()
  2057. if(ENABLE_ACLK)
  2058. set(enable_aclk_POST "yes")
  2059. else()
  2060. set(enable_aclk_POST "no")
  2061. endif()
  2062. configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
  2063. install(PROGRAMS
  2064. ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
  2065. COMPONENT netdata
  2066. DESTINATION "${BINDIR}")
  2067. #
  2068. # We don't check ENABLE_PLUGIN_CGROUP_NETWORK because rpm builds assume
  2069. # the files exists unconditionally.
  2070. #
  2071. configure_file(src/collectors/cgroups.plugin/cgroup-network-helper.sh.in
  2072. src/collectors/cgroups.plugin/cgroup-network-helper.sh @ONLY)
  2073. install(PROGRAMS
  2074. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-network-helper.sh
  2075. COMPONENT netdata
  2076. DESTINATION usr/libexec/netdata/plugins.d)
  2077. configure_file(src/collectors/cgroups.plugin/cgroup-name.sh.in
  2078. src/collectors/cgroups.plugin/cgroup-name.sh @ONLY)
  2079. install(PROGRAMS
  2080. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-name.sh
  2081. COMPONENT netdata
  2082. DESTINATION usr/libexec/netdata/plugins.d)
  2083. #
  2084. # statsd
  2085. #
  2086. install(FILES
  2087. src/collectors/statsd.plugin/asterisk.conf
  2088. src/collectors/statsd.plugin/example.conf
  2089. src/collectors/statsd.plugin/k6.conf
  2090. COMPONENT netdata
  2091. DESTINATION usr/lib/netdata/conf.d/statsd.d)
  2092. #
  2093. # exporting
  2094. #
  2095. install(FILES
  2096. src/exporting/exporting.conf
  2097. COMPONENT netdata
  2098. DESTINATION usr/lib/netdata/conf.d)
  2099. #
  2100. # ioping.plugin
  2101. #
  2102. install(FILES
  2103. src/collectors/ioping.plugin/ioping.conf
  2104. COMPONENT netdata
  2105. DESTINATION usr/lib/netdata/conf.d)
  2106. #
  2107. # streaming
  2108. #
  2109. install(FILES
  2110. src/streaming/stream.conf
  2111. COMPONENT netdata
  2112. DESTINATION usr/lib/netdata/conf.d)
  2113. #
  2114. # swagger
  2115. #
  2116. install(FILES
  2117. src/web/api/netdata-swagger.json
  2118. src/web/api/netdata-swagger.yaml
  2119. COMPONENT netdata
  2120. DESTINATION ${WEB_DEST})
  2121. #
  2122. # service files
  2123. #
  2124. configure_file(system/install-service.sh.in system/install-service.sh @ONLY)
  2125. install(PROGRAMS
  2126. ${CMAKE_BINARY_DIR}/system/install-service.sh
  2127. COMPONENT netdata
  2128. DESTINATION usr/libexec/netdata)
  2129. configure_file(system/cron/netdata-updater-daily.in system/cron/netdata-updater-daily @ONLY)
  2130. install(FILES
  2131. ${CMAKE_BINARY_DIR}/system/cron/netdata-updater-daily
  2132. COMPONENT netdata
  2133. DESTINATION usr/lib/netdata/system/cron)
  2134. configure_file(system/launchd/netdata.plist.in system/launchd/netdata.plist @ONLY)
  2135. install(FILES
  2136. ${CMAKE_BINARY_DIR}/system/launchd/netdata.plist
  2137. COMPONENT netdata
  2138. DESTINATION usr/lib/netdata/system/launchd)
  2139. configure_file(system/freebsd/rc.d/netdata.in system/freebsd/rc.d/netdata @ONLY)
  2140. install(PROGRAMS
  2141. ${CMAKE_BINARY_DIR}/system/freebsd/rc.d/netdata
  2142. COMPONENT netdata
  2143. DESTINATION usr/lib/netdata/system/freebsd/rc.d)
  2144. configure_file(system/initd/init.d/netdata.in system/initd/init.d/netdata @ONLY)
  2145. install(PROGRAMS
  2146. ${CMAKE_BINARY_DIR}/system/initd/init.d/netdata
  2147. COMPONENT netdata
  2148. DESTINATION usr/lib/netdata/system/initd/init.d)
  2149. configure_file(system/logrotate/netdata.in system/logrotate/netdata @ONLY)
  2150. install(FILES
  2151. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2152. COMPONENT netdata
  2153. DESTINATION usr/lib/netdata/system/logrotate)
  2154. install(FILES
  2155. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2156. COMPONENT netdata
  2157. DESTINATION etc/logrotate.d)
  2158. configure_file(system/lsb/init.d/netdata.in system/lsb/init.d/netdata @ONLY)
  2159. install(PROGRAMS
  2160. ${CMAKE_BINARY_DIR}/system/lsb/init.d/netdata
  2161. COMPONENT netdata
  2162. DESTINATION usr/lib/netdata/system/lsb/init.d)
  2163. configure_file(system/openrc/conf.d/netdata.in system/openrc/conf.d/netdata @ONLY)
  2164. install(FILES
  2165. ${CMAKE_BINARY_DIR}/system/openrc/conf.d/netdata
  2166. COMPONENT netdata
  2167. DESTINATION usr/lib/netdata/system/openrc/conf.d)
  2168. configure_file(system/openrc/init.d/netdata.in system/openrc/init.d/netdata @ONLY)
  2169. install(PROGRAMS
  2170. ${CMAKE_BINARY_DIR}/system/openrc/init.d/netdata
  2171. COMPONENT netdata
  2172. DESTINATION usr/lib/netdata/system/openrc/init.d)
  2173. configure_file(system/runit/run.in system/runit/run @ONLY)
  2174. install(PROGRAMS
  2175. ${CMAKE_BINARY_DIR}/system/runit/run
  2176. COMPONENT netdata
  2177. DESTINATION usr/lib/netdata/system/runit)
  2178. configure_file(system/dinit/netdata.in system/dinit/netdata @ONLY)
  2179. install(FILES
  2180. ${CMAKE_BINARY_DIR}/system/dinit/netdata
  2181. COMPONENT netdata
  2182. DESTINATION usr/lib/netdata/system/dinit)
  2183. configure_file(system/systemd/netdata.service.in system/systemd/netdata.service @ONLY)
  2184. install(FILES
  2185. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2186. COMPONENT netdata
  2187. DESTINATION usr/lib/netdata/system/systemd)
  2188. install(FILES
  2189. system/systemd/journald@netdata.conf
  2190. COMPONENT netdata
  2191. DESTINATION usr/lib/netdata/system/systemd)
  2192. configure_file(system/systemd/netdata.service.v235.in system/systemd/netdata.service.v235 @ONLY)
  2193. install(FILES
  2194. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service.v235
  2195. COMPONENT netdata
  2196. DESTINATION usr/lib/netdata/system/systemd)
  2197. configure_file(system/systemd/netdata-updater.service.in system/systemd/netdata-updater.service @ONLY)
  2198. install(FILES
  2199. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2200. COMPONENT netdata
  2201. DESTINATION usr/lib/netdata/system/systemd)
  2202. install(FILES
  2203. system/systemd/netdata-updater.timer
  2204. COMPONENT netdata
  2205. DESTINATION usr/lib/netdata/system/systemd)
  2206. if(BUILD_FOR_PACKAGING)
  2207. install(FILES
  2208. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2209. COMPONENT netdata
  2210. DESTINATION lib/systemd/system)
  2211. install(FILES
  2212. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2213. COMPONENT netdata
  2214. DESTINATION lib/systemd/system)
  2215. install(FILES
  2216. system/systemd/netdata-updater.timer
  2217. COMPONENT netdata
  2218. DESTINATION lib/systemd/system)
  2219. install(DIRECTORY
  2220. COMPONENT netdata
  2221. DESTINATION usr/lib/systemd/journald@netdata.conf.d)
  2222. install(FILES
  2223. system/systemd/journald@netdata.conf
  2224. COMPONENT netdata
  2225. DESTINATION usr/lib/systemd/journald@netdata.conf.d
  2226. RENAME netdata.conf)
  2227. endif()
  2228. install(FILES
  2229. system/systemd/50-netdata.preset
  2230. COMPONENT netdata
  2231. DESTINATION usr/lib/netdata/system/systemd)
  2232. install(FILES
  2233. system/vnodes/vnodes.conf
  2234. COMPONENT netdata
  2235. DESTINATION usr/lib/netdata/conf.d/vnodes)
  2236. install(FILES
  2237. system/.install-type
  2238. COMPONENT netdata
  2239. DESTINATION etc/netdata)
  2240. install(PROGRAMS
  2241. system/edit-config
  2242. COMPONENT netdata
  2243. DESTINATION etc/netdata)
  2244. if(BUILD_FOR_PACKAGING)
  2245. set(NETDATA_CONF_DEST "etc/netdata")
  2246. else()
  2247. set(NETDATA_CONF_DEST "usr/lib/netdata/conf.d")
  2248. endif()
  2249. install(FILES
  2250. system/netdata.conf
  2251. system/netdata-updater.conf
  2252. COMPONENT netdata
  2253. DESTINATION ${NETDATA_CONF_DEST})
  2254. #
  2255. # misc files
  2256. #
  2257. if(BUILD_FOR_PACKAGING)
  2258. install(FILES
  2259. ${PKG_FILES_PATH}/deb/netdata/etc/default/netdata
  2260. COMPONENT netdata
  2261. DESTINATION etc/default)
  2262. install(PROGRAMS
  2263. ${PKG_FILES_PATH}/deb/netdata/etc/init.d/netdata
  2264. COMPONENT netdata
  2265. DESTINATION etc/init.d)
  2266. endif()
  2267. install(PROGRAMS
  2268. packaging/installer/netdata-updater.sh
  2269. COMPONENT netdata
  2270. DESTINATION usr/libexec/netdata)
  2271. #
  2272. # TODO: check the following files for correct substitutions
  2273. #
  2274. configure_file(src/daemon/anonymous-statistics.sh.in src/daemon/anonymous-statistics.sh @ONLY)
  2275. install(PROGRAMS
  2276. ${CMAKE_BINARY_DIR}/src/daemon/anonymous-statistics.sh
  2277. COMPONENT netdata
  2278. DESTINATION usr/libexec/netdata/plugins.d)
  2279. configure_file(src/daemon/get-kubernetes-labels.sh.in src/daemon/get-kubernetes-labels.sh @ONLY)
  2280. install(PROGRAMS
  2281. ${CMAKE_BINARY_DIR}/src/daemon/get-kubernetes-labels.sh
  2282. COMPONENT netdata
  2283. DESTINATION usr/libexec/netdata/plugins.d)
  2284. install(PROGRAMS
  2285. src/daemon/system-info.sh
  2286. COMPONENT netdata
  2287. DESTINATION usr/libexec/netdata/plugins.d)
  2288. #
  2289. # health files
  2290. #
  2291. file(GLOB_RECURSE HEALTH_CONF_FILES "src/health/health.d/*.conf")
  2292. install(FILES
  2293. ${HEALTH_CONF_FILES}
  2294. COMPONENT netdata
  2295. DESTINATION usr/lib/netdata/conf.d/health.d)
  2296. configure_file(src/health/notifications/alarm-notify.sh.in src/health/notifications/alarm-notify.sh @ONLY)
  2297. install(PROGRAMS
  2298. ${CMAKE_BINARY_DIR}/src/health/notifications/alarm-notify.sh
  2299. COMPONENT netdata
  2300. DESTINATION usr/libexec/netdata/plugins.d)
  2301. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  2302. install(PROGRAMS
  2303. src/health/notifications/alarm-email.sh
  2304. src/health/notifications/alarm-test.sh
  2305. COMPONENT netdata
  2306. DESTINATION usr/libexec/netdata/plugins.d)
  2307. endif()
  2308. install(FILES
  2309. src/health/notifications/health_alarm_notify.conf
  2310. src/health/notifications/health_email_recipients.conf
  2311. COMPONENT netdata
  2312. DESTINATION usr/lib/netdata/conf.d)
  2313. #
  2314. # test/ files
  2315. #
  2316. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  2317. configure_file(tests/health_mgmtapi/health-cmdapi-test.sh.in tests/health_mgmtapi/health-cmdapi-test.sh @ONLY)
  2318. configure_file(tests/acls/acl.sh.in tests/acls/acl.sh @ONLY)
  2319. configure_file(tests/urls/request.sh.in tests/urls/request.sh @ONLY)
  2320. configure_file(tests/alarm_repetition/alarm.sh.in tests/alarm_repetition/alarm.sh @ONLY)
  2321. configure_file(tests/template_dimension/template_dim.sh.in tests/template_dimension/template_dim.sh @ONLY)
  2322. configure_file(tests/ebpf/ebpf_thread_function.sh.in tests/ebpf/ebpf_thread_function.sh @ONLY)
  2323. install(FILES
  2324. ${CMAKE_BINARY_DIR}/tests/health_mgmtapi/health-cmdapi-test.sh
  2325. ${CMAKE_BINARY_DIR}/tests/acls/acl.sh
  2326. ${CMAKE_BINARY_DIR}/tests/urls/request.sh
  2327. ${CMAKE_BINARY_DIR}/tests/alarm_repetition/alarm.sh
  2328. ${CMAKE_BINARY_DIR}/tests/template_dimension/template_dim.sh
  2329. ${CMAKE_BINARY_DIR}/tests/ebpf/ebpf_thread_function.sh
  2330. DESTINATION usr/libexec/netdata/plugins.d)
  2331. endif()
  2332. #
  2333. # charts.d plugin
  2334. #
  2335. install(DIRECTORY COMPONENT plugin-chartsd DESTINATION etc/netdata/charts.d)
  2336. configure_file(src/collectors/charts.d.plugin/charts.d.plugin.in src/collectors/charts.d.plugin/charts.d.plugin @ONLY)
  2337. install(PROGRAMS
  2338. ${CMAKE_BINARY_DIR}/src/collectors/charts.d.plugin/charts.d.plugin
  2339. COMPONENT plugin-chartsd
  2340. DESTINATION usr/libexec/netdata/plugins.d)
  2341. install(PROGRAMS
  2342. src/collectors/charts.d.plugin/charts.d.dryrun-helper.sh
  2343. COMPONENT plugin-chartsd
  2344. DESTINATION usr/libexec/netdata/plugins.d)
  2345. # loopsleepms is used by the tc.plugin -> ship it in the netdata component
  2346. install(FILES
  2347. src/collectors/charts.d.plugin/loopsleepms.sh.inc
  2348. COMPONENT netdata
  2349. DESTINATION usr/libexec/netdata/plugins.d)
  2350. install(FILES
  2351. src/collectors/charts.d.plugin/charts.d.conf
  2352. COMPONENT plugin-chartsd
  2353. DESTINATION usr/lib/netdata/conf.d)
  2354. install(PROGRAMS
  2355. src/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
  2356. src/collectors/charts.d.plugin/example/example.chart.sh
  2357. src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
  2358. src/collectors/charts.d.plugin/opensips/opensips.chart.sh
  2359. src/collectors/charts.d.plugin/sensors/sensors.chart.sh
  2360. COMPONENT plugin-chartsd
  2361. DESTINATION usr/libexec/netdata/charts.d)
  2362. install(FILES
  2363. src/collectors/charts.d.plugin/apcupsd/apcupsd.conf
  2364. src/collectors/charts.d.plugin/example/example.conf
  2365. src/collectors/charts.d.plugin/libreswan/libreswan.conf
  2366. src/collectors/charts.d.plugin/opensips/opensips.conf
  2367. src/collectors/charts.d.plugin/sensors/sensors.conf
  2368. COMPONENT plugin-chartsd
  2369. DESTINATION usr/lib/netdata/conf.d/charts.d)
  2370. if(BUILD_FOR_PACKAGING)
  2371. install(FILES
  2372. ${PKG_FILES_PATH}/copyright
  2373. COMPONENT plugin-chartsd
  2374. DESTINATION usr/share/doc/netdata-plugin-chartsd)
  2375. endif()
  2376. #
  2377. # tc-qos-helper
  2378. #
  2379. configure_file(src/collectors/tc.plugin/tc-qos-helper.sh.in src/collectors/tc.plugin/tc-qos-helper.sh @ONLY)
  2380. install(PROGRAMS
  2381. ${CMAKE_BINARY_DIR}/src/collectors/tc.plugin/tc-qos-helper.sh
  2382. COMPONENT netdata
  2383. DESTINATION usr/libexec/netdata/plugins.d)
  2384. # confs
  2385. install(FILES
  2386. src/collectors/systemd-journal.plugin/schema.d/systemd-journal%3Amonitored-directories.json
  2387. src/health/schema.d/health%3Aalert%3Aprototype.json
  2388. COMPONENT netdata
  2389. DESTINATION usr/lib/netdata/conf.d/schema.d)
  2390. #
  2391. # python.d plugin
  2392. #
  2393. configure_file(src/collectors/python.d.plugin/python.d.plugin.in src/collectors/python.d.plugin/python.d.plugin @ONLY)
  2394. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/python.d.plugin/python.d.plugin
  2395. COMPONENT plugin-pythond
  2396. DESTINATION usr/libexec/netdata/plugins.d)
  2397. install(DIRECTORY src/collectors/python.d.plugin/python_modules
  2398. COMPONENT plugin-pythond
  2399. DESTINATION usr/libexec/netdata/python.d)
  2400. install(FILES src/collectors/python.d.plugin/python.d.conf
  2401. COMPONENT plugin-pythond
  2402. DESTINATION usr/lib/netdata/conf.d)
  2403. install(FILES
  2404. src/collectors/python.d.plugin/alarms/alarms.conf
  2405. src/collectors/python.d.plugin/am2320/am2320.conf
  2406. src/collectors/python.d.plugin/anomalies/anomalies.conf
  2407. src/collectors/python.d.plugin/beanstalk/beanstalk.conf
  2408. src/collectors/python.d.plugin/boinc/boinc.conf
  2409. src/collectors/python.d.plugin/ceph/ceph.conf
  2410. src/collectors/python.d.plugin/changefinder/changefinder.conf
  2411. src/collectors/python.d.plugin/dovecot/dovecot.conf
  2412. src/collectors/python.d.plugin/example/example.conf
  2413. src/collectors/python.d.plugin/exim/exim.conf
  2414. src/collectors/python.d.plugin/gearman/gearman.conf
  2415. src/collectors/python.d.plugin/go_expvar/go_expvar.conf
  2416. src/collectors/python.d.plugin/haproxy/haproxy.conf
  2417. src/collectors/python.d.plugin/memcached/memcached.conf
  2418. src/collectors/python.d.plugin/monit/monit.conf
  2419. src/collectors/python.d.plugin/nsd/nsd.conf
  2420. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.conf
  2421. src/collectors/python.d.plugin/openldap/openldap.conf
  2422. src/collectors/python.d.plugin/oracledb/oracledb.conf
  2423. src/collectors/python.d.plugin/pandas/pandas.conf
  2424. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.conf
  2425. src/collectors/python.d.plugin/retroshare/retroshare.conf
  2426. src/collectors/python.d.plugin/riakkv/riakkv.conf
  2427. src/collectors/python.d.plugin/samba/samba.conf
  2428. src/collectors/python.d.plugin/spigotmc/spigotmc.conf
  2429. src/collectors/python.d.plugin/squid/squid.conf
  2430. src/collectors/python.d.plugin/tomcat/tomcat.conf
  2431. src/collectors/python.d.plugin/tor/tor.conf
  2432. src/collectors/python.d.plugin/traefik/traefik.conf
  2433. src/collectors/python.d.plugin/uwsgi/uwsgi.conf
  2434. src/collectors/python.d.plugin/varnish/varnish.conf
  2435. src/collectors/python.d.plugin/w1sensor/w1sensor.conf
  2436. src/collectors/python.d.plugin/zscores/zscores.conf
  2437. COMPONENT plugin-pythond
  2438. DESTINATION usr/lib/netdata/conf.d/python.d)
  2439. install(FILES
  2440. src/collectors/python.d.plugin/alarms/alarms.chart.py
  2441. src/collectors/python.d.plugin/am2320/am2320.chart.py
  2442. src/collectors/python.d.plugin/anomalies/anomalies.chart.py
  2443. src/collectors/python.d.plugin/beanstalk/beanstalk.chart.py
  2444. src/collectors/python.d.plugin/boinc/boinc.chart.py
  2445. src/collectors/python.d.plugin/ceph/ceph.chart.py
  2446. src/collectors/python.d.plugin/changefinder/changefinder.chart.py
  2447. src/collectors/python.d.plugin/dovecot/dovecot.chart.py
  2448. src/collectors/python.d.plugin/example/example.chart.py
  2449. src/collectors/python.d.plugin/exim/exim.chart.py
  2450. src/collectors/python.d.plugin/gearman/gearman.chart.py
  2451. src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
  2452. src/collectors/python.d.plugin/haproxy/haproxy.chart.py
  2453. src/collectors/python.d.plugin/memcached/memcached.chart.py
  2454. src/collectors/python.d.plugin/monit/monit.chart.py
  2455. src/collectors/python.d.plugin/nsd/nsd.chart.py
  2456. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
  2457. src/collectors/python.d.plugin/openldap/openldap.chart.py
  2458. src/collectors/python.d.plugin/oracledb/oracledb.chart.py
  2459. src/collectors/python.d.plugin/pandas/pandas.chart.py
  2460. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.chart.py
  2461. src/collectors/python.d.plugin/retroshare/retroshare.chart.py
  2462. src/collectors/python.d.plugin/riakkv/riakkv.chart.py
  2463. src/collectors/python.d.plugin/samba/samba.chart.py
  2464. src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
  2465. src/collectors/python.d.plugin/squid/squid.chart.py
  2466. src/collectors/python.d.plugin/tomcat/tomcat.chart.py
  2467. src/collectors/python.d.plugin/tor/tor.chart.py
  2468. src/collectors/python.d.plugin/traefik/traefik.chart.py
  2469. src/collectors/python.d.plugin/uwsgi/uwsgi.chart.py
  2470. src/collectors/python.d.plugin/varnish/varnish.chart.py
  2471. src/collectors/python.d.plugin/w1sensor/w1sensor.chart.py
  2472. src/collectors/python.d.plugin/zscores/zscores.chart.py
  2473. COMPONENT plugin-pythond
  2474. DESTINATION usr/libexec/netdata/python.d)
  2475. if(BUILD_FOR_PACKAGING)
  2476. install(FILES
  2477. ${PKG_FILES_PATH}/copyright
  2478. COMPONENT plugin-pythond
  2479. DESTINATION usr/share/doc/netdata-plugin-pythond)
  2480. endif()
  2481. #
  2482. # ioping.plugin
  2483. #
  2484. configure_file(src/collectors/ioping.plugin/ioping.plugin.in src/collectors/ioping.plugin/ioping.plugin @ONLY)
  2485. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/ioping.plugin/ioping.plugin
  2486. COMPONENT netdata
  2487. DESTINATION usr/libexec/netdata/plugins.d)
  2488. #
  2489. # go.d.plugin
  2490. #
  2491. if(ENABLE_PLUGIN_GO)
  2492. install(FILES src/go/plugin/go.d/config/go.d.conf
  2493. COMPONENT plugin-go
  2494. DESTINATION usr/lib/netdata/conf.d)
  2495. install(DIRECTORY
  2496. COMPONENT plugin-go
  2497. DESTINATION usr/lib/netdata/conf.d/go.d)
  2498. file(GLOB GO_CONF_FILES src/go/plugin/go.d/config/go.d/*.conf)
  2499. install(FILES ${GO_CONF_FILES}
  2500. COMPONENT plugin-go
  2501. DESTINATION usr/lib/netdata/conf.d/go.d)
  2502. install(DIRECTORY
  2503. COMPONENT plugin-go
  2504. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  2505. file(GLOB GO_SD_CONF_FILES src/go/plugin/go.d/config/go.d/sd/*.conf)
  2506. install(FILES ${GO_SD_CONF_FILES}
  2507. COMPONENT plugin-go
  2508. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  2509. if(BUILD_FOR_PACKAGING)
  2510. install(FILES
  2511. ${PKG_FILES_PATH}/copyright
  2512. COMPONENT plugin-go
  2513. DESTINATION usr/share/doc/netdata-plugin-go)
  2514. endif()
  2515. endif()
  2516. #
  2517. # dashboard
  2518. #
  2519. include(src/web/gui/v1/dashboard_v1.cmake)
  2520. include(src/web/gui/v2/dashboard_v2.cmake)
  2521. include(src/web/gui/gui.cmake)
  2522. function(cat IN_FILE OUT_FILE)
  2523. file(READ ${IN_FILE} CONTENTS)
  2524. file(APPEND ${OUT_FILE} "${CONTENTS}")
  2525. endfunction()
  2526. file(WRITE ${CMAKE_BINARY_DIR}/src/web/gui/dashboard.js.in "")
  2527. foreach(JS_FILE ${DASHBOARD_JS_FILES})
  2528. cat(${JS_FILE} ${CMAKE_BINARY_DIR}/dashboard.js.in)
  2529. endforeach()
  2530. configure_file(${CMAKE_BINARY_DIR}/dashboard.js.in
  2531. ${CMAKE_BINARY_DIR}/dashboard.js COPYONLY)
  2532. install(FILES
  2533. ${CMAKE_BINARY_DIR}/dashboard.js
  2534. COMPONENT netdata
  2535. DESTINATION ${WEB_DEST})
  2536. install(FILES
  2537. src/web/gui/dashboard_info_custom_example.js
  2538. src/web/gui/dashboard_info.js
  2539. src/web/gui/index.html
  2540. src/web/gui/main.css
  2541. src/web/gui/main.js
  2542. src/web/gui/registry-access.html
  2543. src/web/gui/registry-alert-redirect.html
  2544. src/web/gui/registry-hello.html
  2545. src/web/gui/switch.html
  2546. src/web/gui/ilove.html
  2547. COMPONENT netdata
  2548. DESTINATION ${WEB_DEST})
  2549. install(FILES
  2550. src/web/gui/old/index.html
  2551. COMPONENT netdata
  2552. DESTINATION ${WEB_DEST}/old)
  2553. install(FILES
  2554. src/web/gui/static/img/netdata-logomark.svg
  2555. COMPONENT netdata
  2556. DESTINATION ${WEB_DEST}/static/img)
  2557. install(FILES
  2558. src/web/gui/css/morris-0.5.1.css
  2559. src/web/gui/css/c3-0.4.18.min.css
  2560. COMPONENT netdata
  2561. DESTINATION ${WEB_DEST}/css)
  2562. install(FILES
  2563. src/web/gui/.well-known/dnt/cookies
  2564. COMPONENT netdata
  2565. DESTINATION ${WEB_DEST}/.well-known/dnt)
  2566. if(NOT OS_WINDOWS)
  2567. # v0 dashboard
  2568. install(FILES
  2569. src/web/gui/v0/index.html
  2570. COMPONENT netdata
  2571. DESTINATION ${WEB_DEST}/v0)
  2572. endif()
  2573. if(OS_WINDOWS)
  2574. install(FILES /usr/bin/awk.exe
  2575. /usr/bin/bash.exe
  2576. /usr/bin/cat.exe
  2577. /usr/bin/chown.exe
  2578. /usr/bin/curl.exe
  2579. /usr/bin/env.exe
  2580. /usr/bin/grep.exe
  2581. /usr/bin/mkdir.exe
  2582. /usr/bin/openssl.exe
  2583. /usr/bin/rm.exe
  2584. /usr/bin/sed.exe
  2585. /usr/bin/sh.exe
  2586. /usr/bin/tail.exe
  2587. /usr/bin/tr.exe
  2588. /usr/bin/uuidgen.exe
  2589. /usr/bin/whoami.exe
  2590. DESTINATION "${BINDIR}")
  2591. install(FILES /usr/bin/msys-2.0.dll
  2592. /usr/bin/msys-asn1-8.dll
  2593. /usr/bin/msys-brotlicommon-1.dll
  2594. /usr/bin/msys-brotlidec-1.dll
  2595. /usr/bin/msys-brotlienc-1.dll
  2596. /usr/bin/msys-com_err-1.dll
  2597. /usr/bin/msys-crypt-2.dll
  2598. /usr/bin/msys-crypto-3.dll
  2599. /usr/bin/msys-curl-4.dll
  2600. /usr/bin/msys-gcc_s-seh-1.dll
  2601. /usr/bin/msys-gmp-10.dll
  2602. /usr/bin/msys-gssapi-3.dll
  2603. /usr/bin/msys-hcrypto-4.dll
  2604. /usr/bin/msys-heimbase-1.dll
  2605. /usr/bin/msys-heimntlm-0.dll
  2606. /usr/bin/msys-hx509-5.dll
  2607. /usr/bin/msys-iconv-2.dll
  2608. /usr/bin/msys-idn2-0.dll
  2609. /usr/bin/msys-intl-8.dll
  2610. /usr/bin/msys-krb5-26.dll
  2611. /usr/bin/msys-lz4-1.dll
  2612. /usr/bin/msys-mpfr-6.dll
  2613. /usr/bin/msys-ncursesw6.dll
  2614. /usr/bin/msys-nghttp2-14.dll
  2615. /usr/bin/msys-pcre-1.dll
  2616. /usr/bin/msys-protobuf-32.dll
  2617. /usr/bin/msys-psl-5.dll
  2618. /usr/bin/msys-readline8.dll
  2619. /usr/bin/msys-roken-18.dll
  2620. /usr/bin/msys-sqlite3-0.dll
  2621. /usr/bin/msys-ssh2-1.dll
  2622. /usr/bin/msys-ssl-3.dll
  2623. /usr/bin/msys-stdc++-6.dll
  2624. /usr/bin/msys-unistring-5.dll
  2625. /usr/bin/msys-uuid-1.dll
  2626. /usr/bin/msys-uv-1.dll
  2627. /usr/bin/msys-wind-0.dll
  2628. /usr/bin/msys-z.dll
  2629. /usr/bin/msys-zstd-1.dll
  2630. DESTINATION "${BINDIR}")
  2631. # Make bash & netdata happy
  2632. install(DIRECTORY DESTINATION tmp)
  2633. # Make curl work with ssl
  2634. install(DIRECTORY /usr/ssl DESTINATION usr)
  2635. endif()
  2636. include(Packaging)