CMakeLists.txt 136 KB

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