CMakeLists.txt 128 KB

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