CMakeLists.txt 122 KB

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