CMakeLists.txt 127 KB

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