CMakeLists.txt 136 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667
  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. )
  929. list(APPEND LIBNETDATA_FILES ${INICFG_FILES})
  930. list(APPEND LIBNETDATA_FILES ${CONFIG_FILES})
  931. set(LIBH2O_FILES
  932. src/web/server/h2o/libh2o/deps/cloexec/cloexec.c
  933. src/web/server/h2o/libh2o/deps/libgkc/gkc.c
  934. src/web/server/h2o/libh2o/deps/libyrmcds/close.c
  935. src/web/server/h2o/libh2o/deps/libyrmcds/connect.c
  936. src/web/server/h2o/libh2o/deps/libyrmcds/recv.c
  937. src/web/server/h2o/libh2o/deps/libyrmcds/send.c
  938. src/web/server/h2o/libh2o/deps/libyrmcds/send_text.c
  939. src/web/server/h2o/libh2o/deps/libyrmcds/socket.c
  940. src/web/server/h2o/libh2o/deps/libyrmcds/strerror.c
  941. src/web/server/h2o/libh2o/deps/libyrmcds/text_mode.c
  942. src/web/server/h2o/libh2o/deps/picohttpparser/picohttpparser.c
  943. src/web/server/h2o/libh2o/lib/common/cache.c
  944. src/web/server/h2o/libh2o/lib/common/file.c
  945. src/web/server/h2o/libh2o/lib/common/filecache.c
  946. src/web/server/h2o/libh2o/lib/common/hostinfo.c
  947. src/web/server/h2o/libh2o/lib/common/http1client.c
  948. src/web/server/h2o/libh2o/lib/common/memcached.c
  949. src/web/server/h2o/libh2o/lib/common/memory.c
  950. src/web/server/h2o/libh2o/lib/common/multithread.c
  951. src/web/server/h2o/libh2o/lib/common/serverutil.c
  952. src/web/server/h2o/libh2o/lib/common/socket.c
  953. src/web/server/h2o/libh2o/lib/common/socketpool.c
  954. src/web/server/h2o/libh2o/lib/common/string.c
  955. src/web/server/h2o/libh2o/lib/common/time.c
  956. src/web/server/h2o/libh2o/lib/common/timeout.c
  957. src/web/server/h2o/libh2o/lib/common/url.c
  958. src/web/server/h2o/libh2o/lib/core/config.c
  959. src/web/server/h2o/libh2o/lib/core/configurator.c
  960. src/web/server/h2o/libh2o/lib/core/context.c
  961. src/web/server/h2o/libh2o/lib/core/headers.c
  962. src/web/server/h2o/libh2o/lib/core/logconf.c
  963. src/web/server/h2o/libh2o/lib/core/proxy.c
  964. src/web/server/h2o/libh2o/lib/core/request.c
  965. src/web/server/h2o/libh2o/lib/core/token.c
  966. src/web/server/h2o/libh2o/lib/core/util.c
  967. src/web/server/h2o/libh2o/lib/handler/access_log.c
  968. src/web/server/h2o/libh2o/lib/handler/chunked.c
  969. src/web/server/h2o/libh2o/lib/handler/compress.c
  970. src/web/server/h2o/libh2o/lib/handler/compress/gzip.c
  971. src/web/server/h2o/libh2o/lib/handler/errordoc.c
  972. src/web/server/h2o/libh2o/lib/handler/expires.c
  973. src/web/server/h2o/libh2o/lib/handler/fastcgi.c
  974. src/web/server/h2o/libh2o/lib/handler/file.c
  975. src/web/server/h2o/libh2o/lib/handler/headers.c
  976. src/web/server/h2o/libh2o/lib/handler/mimemap.c
  977. src/web/server/h2o/libh2o/lib/handler/proxy.c
  978. src/web/server/h2o/libh2o/lib/handler/redirect.c
  979. src/web/server/h2o/libh2o/lib/handler/reproxy.c
  980. src/web/server/h2o/libh2o/lib/handler/throttle_resp.c
  981. src/web/server/h2o/libh2o/lib/handler/status.c
  982. src/web/server/h2o/libh2o/lib/handler/headers_util.c
  983. src/web/server/h2o/libh2o/lib/handler/status/events.c
  984. src/web/server/h2o/libh2o/lib/handler/status/requests.c
  985. src/web/server/h2o/libh2o/lib/handler/http2_debug_state.c
  986. src/web/server/h2o/libh2o/lib/handler/status/durations.c
  987. src/web/server/h2o/libh2o/lib/handler/configurator/access_log.c
  988. src/web/server/h2o/libh2o/lib/handler/configurator/compress.c
  989. src/web/server/h2o/libh2o/lib/handler/configurator/errordoc.c
  990. src/web/server/h2o/libh2o/lib/handler/configurator/expires.c
  991. src/web/server/h2o/libh2o/lib/handler/configurator/fastcgi.c
  992. src/web/server/h2o/libh2o/lib/handler/configurator/file.c
  993. src/web/server/h2o/libh2o/lib/handler/configurator/headers.c
  994. src/web/server/h2o/libh2o/lib/handler/configurator/proxy.c
  995. src/web/server/h2o/libh2o/lib/handler/configurator/redirect.c
  996. src/web/server/h2o/libh2o/lib/handler/configurator/reproxy.c
  997. src/web/server/h2o/libh2o/lib/handler/configurator/throttle_resp.c
  998. src/web/server/h2o/libh2o/lib/handler/configurator/status.c
  999. src/web/server/h2o/libh2o/lib/handler/configurator/http2_debug_state.c
  1000. src/web/server/h2o/libh2o/lib/handler/configurator/headers_util.c
  1001. src/web/server/h2o/libh2o/lib/http1.c
  1002. src/web/server/h2o/libh2o/lib/tunnel.c
  1003. src/web/server/h2o/libh2o/lib/http2/cache_digests.c
  1004. src/web/server/h2o/libh2o/lib/http2/casper.c
  1005. src/web/server/h2o/libh2o/lib/http2/connection.c
  1006. src/web/server/h2o/libh2o/lib/http2/frame.c
  1007. src/web/server/h2o/libh2o/lib/http2/hpack.c
  1008. src/web/server/h2o/libh2o/lib/http2/scheduler.c
  1009. src/web/server/h2o/libh2o/lib/http2/stream.c
  1010. src/web/server/h2o/libh2o/lib/http2/http2_debug_state.c
  1011. )
  1012. set(DAEMON_FILES
  1013. src/daemon/buildinfo.c
  1014. src/daemon/buildinfo.h
  1015. src/daemon/h2o-common.c
  1016. src/daemon/common.h
  1017. src/daemon/daemon.c
  1018. src/daemon/daemon.h
  1019. src/daemon/libuv_workers.c
  1020. src/daemon/libuv_workers.h
  1021. src/daemon/pulse/pulse.c
  1022. src/daemon/pulse/pulse.h
  1023. src/daemon/analytics.c
  1024. src/daemon/analytics.h
  1025. src/daemon/main.c
  1026. src/daemon/main.h
  1027. src/daemon/environment.c
  1028. src/daemon/win_system-info.c
  1029. src/daemon/win_system-info.h
  1030. src/daemon/signals.c
  1031. src/daemon/signals.h
  1032. src/daemon/service.c
  1033. src/daemon/daemon-shutdown-watcher.c
  1034. src/daemon/daemon-shutdown-watcher.h
  1035. src/daemon/static_threads.c
  1036. src/daemon/static_threads.h
  1037. src/daemon/commands.c
  1038. src/daemon/commands.h
  1039. src/daemon/pipename.c
  1040. src/daemon/pipename.h
  1041. src/daemon/unit_test.c
  1042. src/daemon/unit_test.h
  1043. src/daemon/dyncfg/dyncfg.c
  1044. src/daemon/dyncfg/dyncfg.h
  1045. src/daemon/dyncfg/dyncfg-files.c
  1046. src/daemon/dyncfg/dyncfg-unittest.c
  1047. src/daemon/dyncfg/dyncfg-inline.c
  1048. src/daemon/dyncfg/dyncfg-echo.c
  1049. src/daemon/dyncfg/dyncfg-internals.h
  1050. src/daemon/dyncfg/dyncfg-intercept.c
  1051. src/daemon/dyncfg/dyncfg-tree.c
  1052. src/daemon/pulse/pulse-http-api.c
  1053. src/daemon/pulse/pulse-http-api.h
  1054. src/daemon/pulse/pulse-queries.c
  1055. src/daemon/pulse/pulse-queries.h
  1056. src/daemon/pulse/pulse-ingestion.c
  1057. src/daemon/pulse/pulse-ingestion.h
  1058. src/daemon/pulse/pulse-ml.c
  1059. src/daemon/pulse/pulse-ml.h
  1060. src/daemon/pulse/pulse-gorilla.c
  1061. src/daemon/pulse/pulse-gorilla.h
  1062. src/daemon/pulse/pulse-daemon.c
  1063. src/daemon/pulse/pulse-daemon.h
  1064. src/daemon/pulse/pulse-daemon-memory.c
  1065. src/daemon/pulse/pulse-daemon-memory.h
  1066. src/daemon/pulse/pulse-sqlite3.c
  1067. src/daemon/pulse/pulse-sqlite3.h
  1068. src/daemon/pulse/pulse-db-dbengine.c
  1069. src/daemon/pulse/pulse-db-dbengine.h
  1070. src/daemon/pulse/pulse-string.c
  1071. src/daemon/pulse/pulse-string.h
  1072. src/daemon/pulse/pulse-heartbeat.c
  1073. src/daemon/pulse/pulse-heartbeat.h
  1074. src/daemon/pulse/pulse-dictionary.c
  1075. src/daemon/pulse/pulse-dictionary.h
  1076. src/daemon/pulse/pulse-workers.c
  1077. src/daemon/pulse/pulse-workers.h
  1078. src/daemon/pulse/pulse-trace-allocations.c
  1079. src/daemon/pulse/pulse-trace-allocations.h
  1080. src/daemon/pulse/pulse-aral.c
  1081. src/daemon/pulse/pulse-aral.h
  1082. src/daemon/config/netdata-conf-db.c
  1083. src/daemon/config/netdata-conf-db.h
  1084. src/daemon/config/netdata-conf.h
  1085. src/daemon/config/netdata-conf-backwards-compatibility.c
  1086. src/daemon/config/netdata-conf-backwards-compatibility.h
  1087. src/daemon/config/netdata-conf-web.c
  1088. src/daemon/config/netdata-conf-web.h
  1089. src/daemon/config/netdata-conf-directories.c
  1090. src/daemon/config/netdata-conf-directories.h
  1091. src/daemon/config/netdata-conf-logs.c
  1092. src/daemon/config/netdata-conf-logs.h
  1093. src/daemon/config/netdata-conf-global.c
  1094. src/daemon/config/netdata-conf-global.h
  1095. src/daemon/config/netdata-conf.c
  1096. src/daemon/daemon-shutdown.c
  1097. src/daemon/daemon-shutdown.h
  1098. src/daemon/daemon-service.c
  1099. src/daemon/daemon-service.h
  1100. src/daemon/pulse/pulse-db-rrd.c
  1101. src/daemon/pulse/pulse-db-rrd.h
  1102. src/daemon/config/netdata-conf-cloud.c
  1103. src/daemon/config/netdata-conf-cloud.h
  1104. src/daemon/config/netdata-conf-profile.c
  1105. src/daemon/config/netdata-conf-profile.h
  1106. src/daemon/pulse/pulse-daemon-memory-system.c
  1107. src/daemon/pulse/pulse-network.c
  1108. src/daemon/pulse/pulse-network.h
  1109. src/daemon/pulse/pulse-db-dbengine-retention.c
  1110. src/daemon/pulse/pulse-db-dbengine-retention.h
  1111. src/daemon/pulse/pulse-parents.c
  1112. src/daemon/pulse/pulse-parents.h
  1113. src/daemon/daemon-status-file.c
  1114. src/daemon/daemon-status-file.h
  1115. src/daemon/config/netdata-conf-ssl.c
  1116. src/daemon/config/netdata-conf-ssl.h
  1117. src/daemon/daemon-systemd-watcher.c
  1118. src/daemon/daemon-systemd-watcher.h
  1119. )
  1120. set(H2O_FILES
  1121. src/web/server/h2o/http_server.c
  1122. src/web/server/h2o/http_server.h
  1123. src/web/server/h2o/h2o_utils.c
  1124. src/web/server/h2o/h2o_utils.h
  1125. src/web/server/h2o/rrdpush.c
  1126. src/web/server/h2o/streaming.h
  1127. src/web/server/h2o/connlist.c
  1128. src/web/server/h2o/connlist.h
  1129. )
  1130. if(ENABLE_H2O)
  1131. list(APPEND DAEMON_FILES ${H2O_FILES})
  1132. endif()
  1133. set(API_PLUGIN_FILES
  1134. src/web/api/web_api.c
  1135. src/web/api/web_api.h
  1136. src/web/api/web_api_v1.c
  1137. src/web/api/web_api_v1.h
  1138. src/web/api/web_api_v2.c
  1139. src/web/api/web_api_v2.h
  1140. src/web/api/web_api_v3.c
  1141. src/web/api/web_api_v3.h
  1142. src/web/api/http_auth.c
  1143. src/web/api/http_auth.h
  1144. src/web/api/http_header.c
  1145. src/web/api/http_header.h
  1146. src/web/api/maps/rrdr_options.c
  1147. src/web/api/maps/rrdr_options.h
  1148. src/web/api/maps/contexts_options.c
  1149. src/web/api/maps/contexts_options.h
  1150. src/web/api/maps/datasource_formats.c
  1151. src/web/api/maps/datasource_formats.h
  1152. src/web/api/maps/maps.h
  1153. src/web/api/maps/contexts_alert_statuses.c
  1154. src/web/api/maps/contexts_alert_statuses.h
  1155. src/web/api/v1/api_v1_allmetrics.c
  1156. src/web/api/v1/api_v1_badge/web_buffer_svg.c
  1157. src/web/api/v1/api_v1_function.c
  1158. src/web/api/v1/api_v1_manage.c
  1159. src/web/api/v1/api_v1_calls.h
  1160. src/web/api/v1/api_v1_dbengine.c
  1161. src/web/api/v1/api_v1_config.c
  1162. src/web/api/v1/api_v1_functions.c
  1163. src/web/api/v1/api_v1_weights.c
  1164. src/web/api/v1/api_v1_info.c
  1165. src/web/api/v1/api_v1_registry.c
  1166. src/web/api/v1/api_v1_data.c
  1167. src/web/api/v1/api_v1_contexts.c
  1168. src/web/api/v1/api_v1_ml_info.c
  1169. src/web/api/v1/api_v1_aclk.c
  1170. src/web/api/v1/api_v1_context.c
  1171. src/web/api/v1/api_v1_alarms.c
  1172. src/web/api/v1/api_v1_charts.c
  1173. src/web/api/v2/api_v2_info.c
  1174. src/web/api/v2/api_v2_nodes.c
  1175. src/web/api/v2/api_v2_node_instances.c
  1176. src/web/api/v2/api_v2_q.c
  1177. src/web/api/v2/api_v2_versions.c
  1178. src/web/api/v2/api_v2_functions.c
  1179. src/web/api/v2/api_v2_alerts.c
  1180. src/web/api/v2/api_v2_alert_transitions.c
  1181. src/web/api/v2/api_v2_ilove/ilove.c
  1182. src/web/api/v2/api_v2_bearer.c
  1183. src/web/api/v2/api_v2_calls.h
  1184. src/web/api/v2/api_v2_data.c
  1185. src/web/api/v2/api_v2_progress.c
  1186. src/web/api/v2/api_v2_weights.c
  1187. src/web/api/v2/api_v2_alert_config.c
  1188. src/web/api/v2/api_v2_contexts.c
  1189. src/web/api/v2/api_v2_claim.c
  1190. src/web/api/v2/api_v2_webrtc.c
  1191. src/web/api/v3/api_v3_calls.h
  1192. src/web/api/v3/api_v3_settings.c
  1193. src/web/api/functions/functions.c
  1194. src/web/api/functions/functions.h
  1195. src/web/api/functions/function-progress.c
  1196. src/web/api/functions/function-progress.h
  1197. src/web/api/functions/function-streaming.c
  1198. src/web/api/functions/function-streaming.h
  1199. src/web/api/queries/rrdr.c
  1200. src/web/api/queries/rrdr.h
  1201. src/web/api/queries/query.c
  1202. src/web/api/queries/query.h
  1203. src/web/api/queries/average/average.c
  1204. src/web/api/queries/average/average.h
  1205. src/web/api/queries/countif/countif.c
  1206. src/web/api/queries/countif/countif.h
  1207. src/web/api/queries/incremental_sum/incremental_sum.c
  1208. src/web/api/queries/incremental_sum/incremental_sum.h
  1209. src/web/api/queries/max/max.c
  1210. src/web/api/queries/max/max.h
  1211. src/web/api/queries/min/min.c
  1212. src/web/api/queries/min/min.h
  1213. src/web/api/queries/sum/sum.c
  1214. src/web/api/queries/sum/sum.h
  1215. src/web/api/queries/median/median.c
  1216. src/web/api/queries/median/median.h
  1217. src/web/api/queries/percentile/percentile.c
  1218. src/web/api/queries/percentile/percentile.h
  1219. src/web/api/queries/stddev/stddev.c
  1220. src/web/api/queries/stddev/stddev.h
  1221. src/web/api/queries/ses/ses.c
  1222. src/web/api/queries/ses/ses.h
  1223. src/web/api/queries/des/des.c
  1224. src/web/api/queries/des/des.h
  1225. src/web/api/queries/trimmed_mean/trimmed_mean.c
  1226. src/web/api/queries/trimmed_mean/trimmed_mean.h
  1227. src/web/api/queries/weights.c
  1228. src/web/api/queries/weights.h
  1229. src/web/api/formatters/rrd2json.c
  1230. src/web/api/formatters/rrd2json.h
  1231. src/web/api/formatters/csv/csv.c
  1232. src/web/api/formatters/csv/csv.h
  1233. src/web/api/formatters/json/json.c
  1234. src/web/api/formatters/json/json.h
  1235. src/web/api/formatters/ssv/ssv.c
  1236. src/web/api/formatters/ssv/ssv.h
  1237. src/web/api/formatters/value/value.c
  1238. src/web/api/formatters/value/value.h
  1239. src/web/api/formatters/json_wrapper.c
  1240. src/web/api/formatters/json_wrapper.h
  1241. src/web/api/formatters/charts2json.c
  1242. src/web/api/formatters/charts2json.h
  1243. src/web/api/formatters/rrdset2json.c
  1244. src/web/api/formatters/rrdset2json.h
  1245. src/web/rtc/webrtc.c
  1246. src/web/rtc/webrtc.h
  1247. src/web/api/functions/function-bearer_get_token.c
  1248. src/web/api/functions/function-bearer_get_token.h
  1249. src/web/api/v3/api_v3_me.c
  1250. )
  1251. set(EXPORTING_ENGINE_FILES
  1252. src/exporting/exporting_engine.c
  1253. src/exporting/exporting_engine.h
  1254. src/exporting/graphite/graphite.c
  1255. src/exporting/graphite/graphite.h
  1256. src/exporting/json/json.c
  1257. src/exporting/json/json.h
  1258. src/exporting/opentsdb/opentsdb.c
  1259. src/exporting/opentsdb/opentsdb.h
  1260. src/exporting/prometheus/prometheus.c
  1261. src/exporting/prometheus/prometheus.h
  1262. src/exporting/read_config.c
  1263. src/exporting/clean_connectors.c
  1264. src/exporting/init_connectors.c
  1265. src/exporting/process_data.c
  1266. src/exporting/check_filters.c
  1267. src/exporting/send_data.c
  1268. src/exporting/send_internal_metrics.c
  1269. )
  1270. set(HEALTH_PLUGIN_FILES
  1271. src/health/health.c
  1272. src/health/health.h
  1273. src/health/health_config.c
  1274. src/health/health_json.c
  1275. src/health/health_log.c
  1276. src/health/health_prototypes.c
  1277. src/health/health_prototypes.h
  1278. src/health/health_silencers.c
  1279. src/health/health_silencers.h
  1280. src/health/health_internals.h
  1281. src/health/health_notifications.c
  1282. src/health/health_event_loop.c
  1283. src/health/health_dyncfg.c
  1284. src/health/health_variable.c
  1285. src/health/rrdcalc.c
  1286. src/health/rrdcalc.h
  1287. src/health/rrdvar.c
  1288. src/health/rrdvar.h
  1289. src/health/health-alert-entry.h
  1290. src/health/health-alert-log.h
  1291. )
  1292. set(IDLEJITTER_PLUGIN_FILES src/collectors/idlejitter.plugin/plugin_idlejitter.c)
  1293. if(ENABLE_ML)
  1294. set(ML_FILES
  1295. src/ml/ad_charts.h
  1296. src/ml/ad_charts.cc
  1297. src/ml/dlib/dlib/all/source.cpp
  1298. src/ml/ml.cc
  1299. src/ml/ml_calculated_number.h
  1300. src/ml/ml_host.h
  1301. src/ml/ml_config.h
  1302. src/ml/ml_config.cc
  1303. src/ml/ml_dimension.h
  1304. src/ml/ml_enums.h
  1305. src/ml/ml_enums.cc
  1306. src/ml/ml_features.h
  1307. src/ml/ml_features.cc
  1308. src/ml/ml_kmeans.h
  1309. src/ml/ml_kmeans.cc
  1310. src/ml/ml_queue.h
  1311. src/ml/ml_worker.h
  1312. src/ml/ml_string_wrapper.h
  1313. src/ml/ml_queue.cc
  1314. src/ml/ml_private.h
  1315. src/ml/ml_public.h
  1316. src/ml/ml_public.cc
  1317. )
  1318. if(NOT ENABLE_MIMALLOC)
  1319. list(APPEND ML_FILES src/ml/ml_memory.cc)
  1320. endif()
  1321. else()
  1322. set(ML_FILES
  1323. src/ml/ml_public.h
  1324. src/ml/ml-dummy.c
  1325. )
  1326. endif()
  1327. set(INTERNAL_COLLECTORS_FILES
  1328. src/collectors/common-contexts/common-contexts.h
  1329. src/collectors/common-contexts/disk-await.h
  1330. src/collectors/common-contexts/disk-avgsz.h
  1331. src/collectors/common-contexts/disk-busy.h
  1332. src/collectors/common-contexts/disk-io.h
  1333. src/collectors/common-contexts/disk-iotime.h
  1334. src/collectors/common-contexts/disk-ops.h
  1335. src/collectors/common-contexts/disk-qops.h
  1336. src/collectors/common-contexts/disk-svctm.h
  1337. src/collectors/common-contexts/disk-util.h
  1338. src/collectors/common-contexts/system-io.h
  1339. src/collectors/common-contexts/system-interrupts.h
  1340. src/collectors/common-contexts/system-processes.h
  1341. src/collectors/common-contexts/system-ram.h
  1342. src/collectors/common-contexts/mem-swap.h
  1343. src/collectors/common-contexts/mem-pgfaults.h
  1344. src/collectors/common-contexts/mem-available.h
  1345. )
  1346. set(PLUGINSD_PLUGIN_FILES
  1347. src/plugins.d/plugins_d.c
  1348. src/plugins.d/plugins_d.h
  1349. src/plugins.d/pluginsd_dyncfg.c
  1350. src/plugins.d/pluginsd_dyncfg.h
  1351. src/plugins.d/pluginsd_functions.c
  1352. src/plugins.d/pluginsd_functions.h
  1353. src/plugins.d/pluginsd_internals.c
  1354. src/plugins.d/pluginsd_internals.h
  1355. src/plugins.d/pluginsd_parser.c
  1356. src/plugins.d/pluginsd_parser.h
  1357. src/plugins.d/pluginsd_replication.c
  1358. src/plugins.d/pluginsd_replication.h
  1359. )
  1360. set(RRD_PLUGIN_FILES
  1361. src/database/contexts/api_v1_contexts.c
  1362. src/database/contexts/api_v2_contexts.c
  1363. src/database/contexts/api_v2_contexts.h
  1364. src/database/contexts/api_v2_contexts_agents.c
  1365. src/database/contexts/api_v2_contexts_alerts.c
  1366. src/database/contexts/api_v2_contexts_alerts.h
  1367. src/database/contexts/api_v2_contexts_alert_transitions.c
  1368. src/database/contexts/api_v2_contexts_alert_config.c
  1369. src/database/contexts/context.c
  1370. src/database/contexts/instance.c
  1371. src/database/contexts/internal.h
  1372. src/database/contexts/metric.c
  1373. src/database/contexts/query_scope.c
  1374. src/database/contexts/query_target.c
  1375. src/database/contexts/rrdcontext.c
  1376. src/database/contexts/rrdcontext.h
  1377. src/database/contexts/worker.c
  1378. src/database/rrdcollector.c
  1379. src/database/rrdcollector.h
  1380. src/database/rrddim.c
  1381. src/database/rrdfunctions.c
  1382. src/database/rrdfunctions.h
  1383. src/database/rrdfunctions-inline.c
  1384. src/database/rrdfunctions-inline.h
  1385. src/database/rrdhost.c
  1386. src/database/rrdlabels.c
  1387. src/database/rrd.c
  1388. src/database/rrd.h
  1389. src/database/rrdset.c
  1390. src/database/storage-engine.c
  1391. src/database/storage-engine.h
  1392. src/database/ram/rrddim_mem.c
  1393. src/database/ram/rrddim_mem.h
  1394. src/database/sqlite/sqlite_metadata.c
  1395. src/database/sqlite/sqlite_metadata.h
  1396. src/database/sqlite/sqlite_functions.c
  1397. src/database/sqlite/sqlite_functions.h
  1398. src/database/sqlite/sqlite_context.c
  1399. src/database/sqlite/sqlite_context.h
  1400. src/database/sqlite/sqlite_db_migration.c
  1401. src/database/sqlite/sqlite_db_migration.h
  1402. src/database/sqlite/sqlite_aclk.c
  1403. src/database/sqlite/sqlite_aclk.h
  1404. src/database/sqlite/sqlite_health.c
  1405. src/database/sqlite/sqlite_health.h
  1406. src/database/sqlite/sqlite_aclk_node.c
  1407. src/database/sqlite/sqlite_aclk_node.h
  1408. src/database/sqlite/sqlite_aclk_alert.c
  1409. src/database/sqlite/sqlite_aclk_alert.h
  1410. src/database/sqlite/vendored/sqlite3.c
  1411. src/database/sqlite/vendored/sqlite3.h
  1412. src/database/sqlite/vendored/sqlite3recover.c
  1413. src/database/sqlite/vendored/sqlite3recover.h
  1414. src/database/sqlite/vendored/dbdata.c
  1415. src/web/api/queries/KolmogorovSmirnovDist.c
  1416. src/web/api/queries/KolmogorovSmirnovDist.h
  1417. src/database/rrdfunctions-inflight.c
  1418. src/database/rrdfunctions-inflight.h
  1419. src/database/rrdfunctions-exporters.c
  1420. src/database/rrdfunctions-exporters.h
  1421. src/database/rrdfunctions-internals.h
  1422. src/database/rrdcollector-internals.h
  1423. src/database/rrd-database-mode.h
  1424. src/database/rrd-database-mode.c
  1425. src/database/rrdhost-system-info.c
  1426. src/database/rrdhost-system-info.h
  1427. src/database/contexts/contexts-loading.c
  1428. src/database/rrdset-index-id.c
  1429. src/database/rrdset-index-id.h
  1430. src/database/rrdset-index-name.c
  1431. src/database/rrdset-index-name.h
  1432. src/database/rrdset-slots.c
  1433. src/database/rrdset-slots.h
  1434. src/database/rrdset-collection.c
  1435. src/database/rrdset-collection.h
  1436. src/database/rrdset.h
  1437. src/database/rrdhost.h
  1438. src/database/rrdhost-status.c
  1439. src/database/rrdhost-status.h
  1440. src/database/rrddim.h
  1441. src/database/rrddim-backfill.c
  1442. src/database/rrddim-backfill.h
  1443. src/database/rrddim-collection.c
  1444. src/database/rrddim-collection.h
  1445. src/database/rrdset-type.c
  1446. src/database/rrdset-type.h
  1447. src/database/rrdhost-slots.c
  1448. src/database/rrdhost-slots.h
  1449. src/database/rrd-algorithm.c
  1450. src/database/rrd-algorithm.h
  1451. src/database/rrdhost-labels.c
  1452. src/database/rrdhost-labels.h
  1453. src/database/rrdhost-collection.c
  1454. src/database/rrdhost-collection.h
  1455. )
  1456. if(ENABLE_DBENGINE)
  1457. list(APPEND RRD_PLUGIN_FILES
  1458. src/database/engine/rrdengine.c
  1459. src/database/engine/rrdengine.h
  1460. src/database/engine/rrddiskprotocol.h
  1461. src/database/engine/datafile.c
  1462. src/database/engine/datafile.h
  1463. src/database/engine/journalfile.c
  1464. src/database/engine/journalfile.h
  1465. src/database/engine/rrdenginelib.c
  1466. src/database/engine/rrdenginelib.h
  1467. src/database/engine/rrdengineapi.c
  1468. src/database/engine/rrdengineapi.h
  1469. src/database/engine/pagecache.c
  1470. src/database/engine/pagecache.h
  1471. src/database/engine/page_test.cc
  1472. src/database/engine/page.c
  1473. src/database/engine/page.h
  1474. src/database/engine/cache.c
  1475. src/database/engine/cache.h
  1476. src/database/engine/metric.c
  1477. src/database/engine/metric.h
  1478. src/database/engine/pdc.c
  1479. src/database/engine/pdc.h
  1480. src/database/engine/dbengine-unittest.c
  1481. src/database/engine/dbengine-stresstest.c
  1482. src/database/engine/dbengine-compression.c
  1483. src/database/engine/dbengine-compression.h
  1484. )
  1485. endif()
  1486. set(REGISTRY_PLUGIN_FILES
  1487. src/registry/registry.c
  1488. src/registry/registry.h
  1489. src/registry/registry_db.c
  1490. src/registry/registry_init.c
  1491. src/registry/registry_internals.c
  1492. src/registry/registry_internals.h
  1493. src/registry/registry_log.c
  1494. src/registry/registry_machine.c
  1495. src/registry/registry_machine.h
  1496. src/registry/registry_person.c
  1497. src/registry/registry_person.h
  1498. )
  1499. set(STATSD_PLUGIN_FILES
  1500. src/collectors/statsd.plugin/statsd.c
  1501. )
  1502. set(SYSTEMD_JOURNAL_PLUGIN_FILES
  1503. src/collectors/systemd-journal.plugin/systemd-journal.c
  1504. src/collectors/systemd-journal.plugin/systemd-internals.h
  1505. src/collectors/systemd-journal.plugin/systemd-main.c
  1506. src/collectors/systemd-journal.plugin/systemd-units.c
  1507. src/collectors/systemd-journal.plugin/systemd-journal.c
  1508. src/collectors/systemd-journal.plugin/systemd-journal-annotations.c
  1509. src/collectors/systemd-journal.plugin/systemd-journal-files.c
  1510. src/collectors/systemd-journal.plugin/systemd-journal-fstat.c
  1511. src/collectors/systemd-journal.plugin/systemd-journal-watcher.c
  1512. src/collectors/systemd-journal.plugin/systemd-journal-dyncfg.c
  1513. src/libnetdata/os/system-maps/system-services.h
  1514. src/collectors/systemd-journal.plugin/systemd-journal-sampling.h
  1515. )
  1516. set(STREAMING_PLUGIN_FILES
  1517. src/streaming/stream.h
  1518. src/streaming/stream-compression/compression.c
  1519. src/streaming/stream-compression/compression.h
  1520. src/streaming/stream-compression/brotli.c
  1521. src/streaming/stream-compression/brotli.h
  1522. src/streaming/stream-compression/gzip.c
  1523. src/streaming/stream-compression/gzip.h
  1524. src/streaming/stream-compression/lz4.c
  1525. src/streaming/stream-compression/lz4.h
  1526. src/streaming/stream-compression/zstd.c
  1527. src/streaming/stream-compression/zstd.h
  1528. src/streaming/stream-receiver.c
  1529. src/streaming/stream-sender.c
  1530. src/streaming/stream-replication-sender.c
  1531. src/streaming/stream-replication-sender.h
  1532. src/streaming/h2o-common.h
  1533. src/streaming/protocol/command-nodeid.c
  1534. src/streaming/protocol/commands.c
  1535. src/streaming/protocol/commands.h
  1536. src/streaming/protocol/command-claimed_id.c
  1537. src/streaming/stream-path.c
  1538. src/streaming/stream-path.h
  1539. src/streaming/stream-capabilities.c
  1540. src/streaming/stream-capabilities.h
  1541. src/streaming/stream-connector.c
  1542. src/streaming/stream-sender-internals.h
  1543. src/streaming/stream-sender-execute.c
  1544. src/streaming/stream-sender-commit.c
  1545. src/streaming/stream-parents.c
  1546. src/streaming/stream-handshake.c
  1547. src/streaming/protocol/command-function.c
  1548. src/streaming/protocol/command-host-labels.c
  1549. src/streaming/protocol/command-chart-definition.c
  1550. src/streaming/protocol/command-begin-set-end-v2.c
  1551. src/streaming/protocol/command-host-variables.c
  1552. src/streaming/stream-conf.c
  1553. src/streaming/stream-conf.h
  1554. src/streaming/stream-handshake.h
  1555. src/streaming/stream-parents.h
  1556. src/streaming/stream-sender-api.c
  1557. src/streaming/stream-receiver-internals.h
  1558. src/streaming/stream-receiver-api.c
  1559. src/streaming/stream-thread.c
  1560. src/streaming/stream-thread.h
  1561. src/streaming/stream-receiver-connection.c
  1562. src/streaming/stream-sender-commit.h
  1563. src/streaming/stream-traffic-types.h
  1564. src/streaming/stream-circular-buffer.c
  1565. src/streaming/stream-circular-buffer.h
  1566. src/streaming/stream-control.c
  1567. src/streaming/stream-control.h
  1568. src/streaming/stream-waiting-list.c
  1569. src/streaming/stream-waiting-list.h
  1570. src/streaming/stream-replication-receiver.c
  1571. src/streaming/stream-replication-receiver.h
  1572. src/streaming/stream-replication-tracking.c
  1573. src/streaming/stream-replication-tracking.h
  1574. src/streaming/protocol/command-begin-set-end-v1.c
  1575. src/streaming/protocol/command-begin-set-end-init.c
  1576. )
  1577. set(WEB_PLUGIN_FILES
  1578. src/web/server/web_client.c
  1579. src/web/server/web_client.h
  1580. src/web/server/web_server.c
  1581. src/web/server/web_server.h
  1582. src/web/server/static/static-threaded.c
  1583. src/web/server/static/static-threaded.h
  1584. src/web/server/web_client_cache.c
  1585. src/web/server/web_client_cache.h
  1586. src/web/api/v3/api_v3_stream_info.c
  1587. src/web/api/v3/api_v3_stream_path.c
  1588. src/web/api/queries/backfill.c
  1589. src/web/api/queries/backfill.h
  1590. src/web/api/functions/function-metrics-cardinality.c
  1591. src/web/api/functions/function-metrics-cardinality.h
  1592. src/web/api/request_source.c
  1593. src/web/api/request_source.h
  1594. )
  1595. set(CLAIM_PLUGIN_FILES
  1596. src/claim/claim.c
  1597. src/claim/claim.h
  1598. src/claim/claim_id.c
  1599. src/claim/claim_id.h
  1600. src/claim/cloud-conf.c
  1601. src/claim/claim-with-api.c
  1602. src/claim/cloud-status.c
  1603. src/claim/cloud-status.h
  1604. )
  1605. set(CLAIM_WINDOWS_FILES
  1606. src/claim/main.c
  1607. src/claim/main.h
  1608. src/claim/ui.c
  1609. src/claim/ui.h
  1610. )
  1611. set(ACLK_ALWAYS_BUILD
  1612. src/aclk/aclk_proxy.c
  1613. src/aclk/aclk_proxy.h
  1614. src/aclk/aclk.c
  1615. src/aclk/aclk.h
  1616. src/aclk/aclk_capas.c
  1617. src/aclk/aclk_capas.h
  1618. src/aclk/aclk_util.c
  1619. src/aclk/aclk_util.h
  1620. src/aclk/https_client.c
  1621. src/aclk/https_client.h
  1622. src/libnetdata/c_rhash/c_rhash.c
  1623. src/libnetdata/c_rhash/c_rhash.h
  1624. src/libnetdata/c_rhash/c_rhash_internal.h
  1625. )
  1626. set(TIMEX_PLUGIN_FILES
  1627. src/collectors/timex.plugin/plugin_timex.c
  1628. )
  1629. set(PROFILE_PLUGIN_FILES
  1630. src/collectors/profile.plugin/plugin_profile.cc
  1631. )
  1632. set(CGROUPS_PLUGIN_FILES
  1633. src/collectors/cgroups.plugin/sys_fs_cgroup.c
  1634. src/collectors/cgroups.plugin/sys_fs_cgroup.h
  1635. src/collectors/cgroups.plugin/cgroup-internals.h
  1636. src/collectors/cgroups.plugin/cgroup-discovery.c
  1637. src/collectors/cgroups.plugin/cgroup-charts.c
  1638. src/collectors/cgroups.plugin/cgroup-top.c
  1639. )
  1640. set(DISKSPACE_PLUGIN_FILES
  1641. src/collectors/diskspace.plugin/plugin_diskspace.c
  1642. )
  1643. set(MACOS_PLUGIN_FILES
  1644. src/collectors/macos.plugin/plugin_macos.c
  1645. src/collectors/macos.plugin/plugin_macos.h
  1646. src/collectors/macos.plugin/macos_sysctl.c
  1647. src/collectors/macos.plugin/macos_mach_smi.c
  1648. src/collectors/macos.plugin/macos_fw.c
  1649. )
  1650. set(FREEBSD_PLUGIN_FILES
  1651. src/collectors/freebsd.plugin/plugin_freebsd.c
  1652. src/collectors/freebsd.plugin/plugin_freebsd.h
  1653. src/collectors/freebsd.plugin/freebsd_sysctl.c
  1654. src/collectors/freebsd.plugin/freebsd_getmntinfo.c
  1655. src/collectors/freebsd.plugin/freebsd_getifaddrs.c
  1656. src/collectors/freebsd.plugin/freebsd_devstat.c
  1657. src/collectors/freebsd.plugin/freebsd_kstat_zfs.c
  1658. src/collectors/freebsd.plugin/freebsd_ipfw.c
  1659. src/collectors/proc.plugin/zfs_common.c
  1660. src/collectors/proc.plugin/zfs_common.h
  1661. )
  1662. set(WINDOWS_EVENTS_PLUGIN_FILES
  1663. src/collectors/windows-events.plugin/windows-events.c
  1664. src/collectors/windows-events.plugin/windows-events.h
  1665. src/collectors/windows-events.plugin/windows-events-query.h
  1666. src/collectors/windows-events.plugin/windows-events-query.c
  1667. src/collectors/windows-events.plugin/windows-events-sources.c
  1668. src/collectors/windows-events.plugin/windows-events-sources.h
  1669. src/collectors/windows-events.plugin/windows-events-unicode.c
  1670. src/collectors/windows-events.plugin/windows-events-unicode.h
  1671. src/collectors/windows-events.plugin/windows-events-xml.c
  1672. src/collectors/windows-events.plugin/windows-events-xml.h
  1673. src/collectors/windows-events.plugin/windows-events-providers.c
  1674. src/collectors/windows-events.plugin/windows-events-providers.h
  1675. src/collectors/windows-events.plugin/windows-events-fields-cache.c
  1676. src/collectors/windows-events.plugin/windows-events-fields-cache.h
  1677. src/collectors/windows-events.plugin/windows-events-query-builder.c
  1678. src/collectors/windows-events.plugin/windows-events-query-builder.h
  1679. src/collectors/windows-events.plugin/windows-events-query-evt-variant.c
  1680. )
  1681. set(WINDOWS_PLUGIN_FILES
  1682. src/collectors/windows.plugin/windows_plugin.c
  1683. src/collectors/windows.plugin/windows_plugin.h
  1684. src/collectors/windows.plugin/GetSystemUptime.c
  1685. src/collectors/windows.plugin/GetSystemRAM.c
  1686. src/collectors/windows.plugin/GetSystemCPU.c
  1687. src/collectors/windows.plugin/perflib-adcs.c
  1688. src/collectors/windows.plugin/perflib-rrd.c
  1689. src/collectors/windows.plugin/perflib-rrd.h
  1690. src/collectors/windows.plugin/perflib-ad.c
  1691. src/collectors/windows.plugin/perflib-mssql.c
  1692. src/collectors/windows.plugin/perflib-storage.c
  1693. src/collectors/windows.plugin/perflib-processor.c
  1694. src/collectors/windows.plugin/perflib-thermalzone.c
  1695. src/collectors/windows.plugin/perflib-objects.c
  1696. src/collectors/windows.plugin/perflib-network.c
  1697. src/collectors/windows.plugin/perflib-netframework.c
  1698. src/collectors/windows.plugin/perflib-memory.c
  1699. src/collectors/windows.plugin/perflib-processes.c
  1700. src/collectors/windows.plugin/perflib-web-service.c
  1701. src/collectors/windows.plugin/perflib-hyperv.c
  1702. )
  1703. set(PROC_PLUGIN_FILES
  1704. src/collectors/proc.plugin/ipc.c
  1705. src/collectors/proc.plugin/plugin_proc.c
  1706. src/collectors/proc.plugin/plugin_proc.h
  1707. src/collectors/proc.plugin/proc_sys_fs_file_nr.c
  1708. src/collectors/proc.plugin/proc_diskstats.c
  1709. src/collectors/proc.plugin/proc_mdstat.c
  1710. src/collectors/proc.plugin/proc_interrupts.c
  1711. src/collectors/proc.plugin/proc_softirqs.c
  1712. src/collectors/proc.plugin/proc_loadavg.c
  1713. src/collectors/proc.plugin/proc_meminfo.c
  1714. src/collectors/proc.plugin/proc_pagetypeinfo.c
  1715. src/collectors/proc.plugin/proc_net_dev.c
  1716. src/collectors/proc.plugin/proc_net_dev_renames.c
  1717. src/collectors/proc.plugin/proc_net_dev_renames.h
  1718. src/collectors/proc.plugin/proc_net_wireless.c
  1719. src/collectors/proc.plugin/proc_net_ip_vs_stats.c
  1720. src/collectors/proc.plugin/proc_net_netstat.c
  1721. src/collectors/proc.plugin/proc_net_rpc_nfs.c
  1722. src/collectors/proc.plugin/proc_net_rpc_nfsd.c
  1723. src/collectors/proc.plugin/proc_net_sctp_snmp.c
  1724. src/collectors/proc.plugin/proc_net_sockstat.c
  1725. src/collectors/proc.plugin/proc_net_sockstat6.c
  1726. src/collectors/proc.plugin/proc_net_softnet_stat.c
  1727. src/collectors/proc.plugin/proc_net_stat_conntrack.c
  1728. src/collectors/proc.plugin/proc_net_stat_synproxy.c
  1729. src/collectors/proc.plugin/proc_self_mountinfo.c
  1730. src/collectors/proc.plugin/proc_self_mountinfo.h
  1731. src/collectors/proc.plugin/zfs_common.c
  1732. src/collectors/proc.plugin/zfs_common.h
  1733. src/collectors/proc.plugin/proc_spl_kstat_zfs.c
  1734. src/collectors/proc.plugin/proc_stat.c
  1735. src/collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  1736. src/collectors/proc.plugin/proc_vmstat.c
  1737. src/collectors/proc.plugin/proc_uptime.c
  1738. src/collectors/proc.plugin/run_reboot_required.c
  1739. src/collectors/proc.plugin/proc_pressure.c
  1740. src/collectors/proc.plugin/proc_pressure.h
  1741. src/collectors/proc.plugin/sys_kernel_mm_ksm.c
  1742. src/collectors/proc.plugin/sys_block_zram.c
  1743. src/collectors/proc.plugin/sys_devices_system_edac_mc.c
  1744. src/collectors/proc.plugin/sys_devices_system_node.c
  1745. src/collectors/proc.plugin/sys_class_infiniband.c
  1746. src/collectors/proc.plugin/sys_fs_btrfs.c
  1747. src/collectors/proc.plugin/sys_class_power_supply.c
  1748. src/collectors/proc.plugin/sys_devices_pci_aer.c
  1749. src/collectors/proc.plugin/sys_class_drm.c
  1750. )
  1751. set(TC_PLUGIN_FILES
  1752. src/collectors/tc.plugin/plugin_tc.c
  1753. )
  1754. set(NETDATA_FILES
  1755. src/collectors/all.h
  1756. ${DAEMON_FILES}
  1757. ${API_PLUGIN_FILES}
  1758. ${EXPORTING_ENGINE_FILES}
  1759. ${HEALTH_PLUGIN_FILES}
  1760. ${IDLEJITTER_PLUGIN_FILES}
  1761. ${ML_FILES}
  1762. ${PLUGINSD_PLUGIN_FILES}
  1763. ${RRD_PLUGIN_FILES}
  1764. ${REGISTRY_PLUGIN_FILES}
  1765. ${STATSD_PLUGIN_FILES}
  1766. ${STREAMING_PLUGIN_FILES}
  1767. ${WEB_PLUGIN_FILES}
  1768. ${CLAIM_PLUGIN_FILES}
  1769. ${ACLK_ALWAYS_BUILD}
  1770. ${PROFILE_PLUGIN_FILES}
  1771. )
  1772. if(OS_LINUX)
  1773. list(APPEND NETDATA_FILES
  1774. src/daemon/static_threads_linux.c
  1775. ${CGROUPS_PLUGIN_FILES}
  1776. ${DISKSPACE_PLUGIN_FILES}
  1777. ${PROC_PLUGIN_FILES}
  1778. ${TC_PLUGIN_FILES}
  1779. ${TIMEX_PLUGIN_FILES}
  1780. ${INTERNAL_COLLECTORS_FILES}
  1781. )
  1782. if(ENABLE_SENTRY)
  1783. list(APPEND NETDATA_FILES
  1784. src/daemon/sentry-native/sentry-native.c
  1785. src/daemon/sentry-native/sentry-native.h)
  1786. endif()
  1787. elseif(OS_MACOS)
  1788. list(APPEND NETDATA_FILES
  1789. src/daemon/static_threads_macos.c
  1790. ${MACOS_PLUGIN_FILES}
  1791. ${TIMEX_PLUGIN_FILES}
  1792. ${INTERNAL_COLLECTORS_FILES}
  1793. )
  1794. elseif(OS_FREEBSD)
  1795. list(APPEND NETDATA_FILES
  1796. src/daemon/static_threads_freebsd.c
  1797. ${FREEBSD_PLUGIN_FILES}
  1798. ${TIMEX_PLUGIN_FILES}
  1799. ${INTERNAL_COLLECTORS_FILES}
  1800. )
  1801. elseif(OS_WINDOWS)
  1802. list(APPEND NETDATA_FILES
  1803. src/daemon/static_threads_windows.c
  1804. src/daemon/winsvc.cc
  1805. ${WINDOWS_PLUGIN_FILES}
  1806. ${INTERNAL_COLLECTORS_FILES}
  1807. )
  1808. endif()
  1809. set(MQTT_WEBSOCKETS_FILES
  1810. src/aclk/mqtt_websockets/mqtt_wss_client.c
  1811. src/aclk/mqtt_websockets/mqtt_wss_client.h
  1812. src/aclk/mqtt_websockets/ws_client.c
  1813. src/aclk/mqtt_websockets/ws_client.h
  1814. src/aclk/mqtt_websockets/mqtt_ng.c
  1815. src/aclk/mqtt_websockets/mqtt_ng.h
  1816. src/aclk/mqtt_websockets/common_public.c
  1817. src/aclk/mqtt_websockets/common_public.h
  1818. src/aclk/mqtt_websockets/common_internal.h
  1819. src/aclk/mqtt_websockets/aclk_mqtt_workers.h
  1820. )
  1821. set(ACLK_PROTO_DEFS
  1822. src/aclk/aclk-schemas/proto/aclk/v1/lib.proto
  1823. src/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
  1824. src/aclk/aclk-schemas/proto/agent/v1/connection.proto
  1825. src/aclk/aclk-schemas/proto/alarm/v1/config.proto
  1826. src/aclk/aclk-schemas/proto/alarm/v1/stream.proto
  1827. src/aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.proto
  1828. src/aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto
  1829. src/aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto
  1830. src/aclk/aclk-schemas/proto/context/v1/context.proto
  1831. src/aclk/aclk-schemas/proto/context/v1/stream.proto
  1832. src/aclk/aclk-schemas/proto/agent/v1/cmds.proto
  1833. )
  1834. set(ACLK_FILES
  1835. src/aclk/aclk_query.c
  1836. src/aclk/aclk_query.h
  1837. src/aclk/aclk_query_queue.c
  1838. src/aclk/aclk_query_queue.h
  1839. src/aclk/aclk_otp.c
  1840. src/aclk/aclk_otp.h
  1841. src/aclk/aclk_tx_msgs.c
  1842. src/aclk/aclk_tx_msgs.h
  1843. src/aclk/aclk_rx_msgs.c
  1844. src/aclk/aclk_rx_msgs.h
  1845. src/aclk/aclk_alarm_api.c
  1846. src/aclk/aclk_alarm_api.h
  1847. src/aclk/aclk_contexts_api.c
  1848. src/aclk/aclk_contexts_api.h
  1849. src/aclk/schema-wrappers/connection.cc
  1850. src/aclk/schema-wrappers/connection.h
  1851. src/aclk/schema-wrappers/node_connection.cc
  1852. src/aclk/schema-wrappers/node_connection.h
  1853. src/aclk/schema-wrappers/node_creation.cc
  1854. src/aclk/schema-wrappers/node_creation.h
  1855. src/aclk/schema-wrappers/alarm_stream.cc
  1856. src/aclk/schema-wrappers/alarm_stream.h
  1857. src/aclk/schema-wrappers/alarm_config.cc
  1858. src/aclk/schema-wrappers/alarm_config.h
  1859. src/aclk/schema-wrappers/node_info.cc
  1860. src/aclk/schema-wrappers/node_info.h
  1861. src/aclk/schema-wrappers/capability.cc
  1862. src/aclk/schema-wrappers/capability.h
  1863. src/aclk/schema-wrappers/proto_2_json.cc
  1864. src/aclk/schema-wrappers/proto_2_json.h
  1865. src/aclk/schema-wrappers/context_stream.cc
  1866. src/aclk/schema-wrappers/context_stream.h
  1867. src/aclk/schema-wrappers/context.cc
  1868. src/aclk/schema-wrappers/context.h
  1869. src/aclk/schema-wrappers/schema_wrappers.h
  1870. src/aclk/schema-wrappers/schema_wrapper_utils.cc
  1871. src/aclk/schema-wrappers/schema_wrapper_utils.h
  1872. src/aclk/schema-wrappers/agent_cmds.cc
  1873. src/aclk/schema-wrappers/agent_cmds.h
  1874. )
  1875. set(MONGODB_EXPORTING_FILES
  1876. src/exporting/mongodb/mongodb.c
  1877. src/exporting/mongodb/mongodb.h
  1878. )
  1879. set(PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1880. src/exporting/prometheus/remote_write/remote_write.c
  1881. src/exporting/prometheus/remote_write/remote_write.h
  1882. src/exporting/prometheus/remote_write/remote_write_request.cc
  1883. src/exporting/prometheus/remote_write/remote_write_request.h
  1884. )
  1885. #
  1886. # build h2o
  1887. #
  1888. if(ENABLE_H2O)
  1889. add_library(h2o STATIC ${LIBH2O_FILES})
  1890. target_include_directories(h2o BEFORE PUBLIC
  1891. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include"
  1892. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/cloexec"
  1893. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/brotli/enc"
  1894. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/golombset"
  1895. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libgkc"
  1896. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/libyrmcds"
  1897. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/klib"
  1898. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/neverbleed"
  1899. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picohttpparser"
  1900. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/picotest"
  1901. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yaml/include"
  1902. "${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/deps/yoml"
  1903. )
  1904. target_compile_options(h2o PRIVATE
  1905. -Wno-all -Wno-extra
  1906. -Wno-shadow
  1907. -Wno-deprecated-declarations
  1908. -Wformat
  1909. )
  1910. target_compile_options(h2o PUBLIC -DH2O_USE_LIBUV=0)
  1911. target_link_libraries(h2o PRIVATE PkgConfig::TLS)
  1912. target_compile_definitions(h2o PRIVATE
  1913. "$<$<NOT:$<BOOL:${ARCH_SUPPORTS_64BIT_ATOMICS}>>:H2O_NO_64BIT_ATOMICS>")
  1914. endif()
  1915. #
  1916. # build libjudy
  1917. #
  1918. add_library(judy STATIC ${LIBJUDY_SOURCES})
  1919. target_compile_options(judy PRIVATE
  1920. -Wno-all -Wno-extra
  1921. -Wno-shadow
  1922. -Wformat
  1923. )
  1924. target_compile_definitions(judy PRIVATE
  1925. JUDYL
  1926. $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:JU_64BIT>
  1927. )
  1928. target_include_directories(judy PUBLIC
  1929. src/libnetdata/libjudy/vendored
  1930. src/libnetdata/libjudy/vendored/JudyCommon
  1931. )
  1932. set_source_files_properties(${LIBJUDY_PREV_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYPREV")
  1933. set_source_files_properties(${LIBJUDY_NEXT_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYNEXT")
  1934. set_source_files_properties(src/libnetdata/libjudy/vendored/JudyL/j__udyLGet.c PROPERTIES COMPILE_OPTIONS "-DJUDYGETINLINE")
  1935. set_source_files_properties(src/libnetdata/libjudy/vendored/JudyL/JudyLByCount.c PROPERTIES COMPILE_OPTIONS "-DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB")
  1936. set_source_files_properties(JudyLTables.c PROPERTIES COMPILE_OPTIONS "-I${CMAKE_SOURCE_DIR}/src/libnetdata/libjudy/src/JudyL")
  1937. #
  1938. # build libnetdata
  1939. #
  1940. if(OS_LINUX)
  1941. include(NetdataDetectSystemd)
  1942. detect_systemd()
  1943. endif()
  1944. add_library(libnetdata STATIC ${LIBNETDATA_FILES})
  1945. target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src)
  1946. # pthread (FIXME: use find_package for this)
  1947. # set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  1948. # set(THREADS_PREFER_PTHREAD_FLAG TRUE)
  1949. # find_package(Threads REQUIRED)
  1950. # add_executable(test test.cpp)
  1951. # target_link_libraries(test Threads::Threads)
  1952. target_link_libraries(libnetdata PUBLIC
  1953. "$<$<BOOL:${ENABLE_MIMALLOC}>:mimalloc-static>"
  1954. "$<$<NOT:$<BOOL:${HAVE_BUILTIN_ATOMICS}>>:atomic>"
  1955. "$<$<OR:$<BOOL:${OS_LINUX}>,$<BOOL:${OS_FREEBSD}>>:pthread;rt>"
  1956. "$<$<BOOL:${OS_WINDOWS}>:kernel32;advapi32;winmm;rpcrt4;wevtapi;ole32;oleaut32;wbemuuid>"
  1957. "$<$<BOOL:${LINK_LIBM}>:m>"
  1958. "${SYSTEMD_LDFLAGS}")
  1959. if(OS_WINDOWS)
  1960. set(HAVE_ETW True)
  1961. set(HAVE_WEL True)
  1962. # Output the results for debugging purposes
  1963. message(STATUS "Have Event Tracing for Windows (ETW): ${HAVE_ETW}")
  1964. message(STATUS "Have Windows Event Log (WEL): ${HAVE_WEL}")
  1965. if(HAVE_WEL OR HAVE_ETW)
  1966. # Define the source and generated file paths
  1967. set(WEVT_GEN_SRC_H_FILE "${CMAKE_SOURCE_DIR}/src/libnetdata/log/nd_log-to-windows-common.h")
  1968. set(WEVT_GEN_SRC_C_FILE "${CMAKE_SOURCE_DIR}/src/libnetdata/log/wevt_netdata_mc_generate.c")
  1969. set(WEVT_GEN_BIN_FILE "${CMAKE_BINARY_DIR}/wevt_netdata_mc_generate")
  1970. set(WEVT_BUILD_SCRIPT "${CMAKE_SOURCE_DIR}/src/libnetdata/log/wevt_netdata_compile.sh")
  1971. set(WEVT_MC_FILE "${CMAKE_BINARY_DIR}/wevt_netdata.mc")
  1972. set(WEVT_MAN_FILE "${CMAKE_BINARY_DIR}/wevt_netdata_manifest.xml")
  1973. set(WEVT_RC_FILE "${CMAKE_BINARY_DIR}/wevt_netdata.rc")
  1974. set(WEVT_MC_H_FILE "${CMAKE_BINARY_DIR}/wevt_netdata.h")
  1975. set(WEVT_MAN_H_FILE "${CMAKE_BINARY_DIR}/wevt_netdata_manifest.h")
  1976. set(WEVT_RES_OBJECT "${CMAKE_BINARY_DIR}/wevt_netdata_res.o")
  1977. set(WEVT_DLL_FILE "${CMAKE_BINARY_DIR}/wevt_netdata.dll")
  1978. set(WEVT_ETW_INSTALL_SCRIPT "${CMAKE_SOURCE_DIR}/src/libnetdata/log/wevt_netdata_install.bat")
  1979. # we compile ${WEVT_GEN_BIN_FILE}, which generates the manifest, the .mc,
  1980. # and the headers required for compiling libnetdata/logs
  1981. if(HAVE_ETW)
  1982. # ETW method also supports WEL
  1983. # but it requires Microsoft tools mc, rc, and link
  1984. add_custom_command(
  1985. OUTPUT "${WEVT_MC_H_FILE}" "${WEVT_MAN_H_FILE}" "${WEVT_DLL_FILE}"
  1986. COMMAND "${CMAKE_C_COMPILER}" -o "${WEVT_GEN_BIN_FILE}" "${WEVT_GEN_SRC_C_FILE}"
  1987. COMMAND "${WEVT_GEN_BIN_FILE}" >"${WEVT_MC_FILE}"
  1988. COMMAND "${WEVT_GEN_BIN_FILE}" --manifest >"${WEVT_MAN_FILE}"
  1989. COMMAND "${WEVT_BUILD_SCRIPT}" "${CMAKE_SOURCE_DIR}/src/libnetdata/log" "${CMAKE_BINARY_DIR}"
  1990. DEPENDS "${WEVT_GEN_SRC_C_FILE}" "${WEVT_GEN_SRC_H_FILE}"
  1991. COMMENT "Compiling ${WEVT_MC_FILE} to generate ${WEVT_MC_H_FILE} and ${WEVT_DLL_FILE}"
  1992. )
  1993. else()
  1994. # WEL method can be built with windmc, windres and the normal linker
  1995. add_custom_command(
  1996. OUTPUT "${WEVT_MC_H_FILE}" "${WEVT_DLL_FILE}"
  1997. COMMAND "${CMAKE_C_COMPILER}" -o "${WEVT_GEN_BIN_FILE}" "${WEVT_GEN_SRC_C_FILE}"
  1998. COMMAND "${WEVT_GEN_BIN_FILE}" >"${WEVT_MC_FILE}"
  1999. COMMAND "${WEVT_GEN_BIN_FILE}" --manifest >"${WEVT_MAN_FILE}"
  2000. COMMAND windmc -r "${CMAKE_BINARY_DIR}" -h "${CMAKE_BINARY_DIR}" ${WEVT_MC_FILE}
  2001. COMMAND echo "1 2004" "wevt_netdata_manifest.xml" >> "${WEVT_RC_FILE}"
  2002. COMMAND windres ${WEVT_RC_FILE} -o ${WEVT_RES_OBJECT}
  2003. COMMAND ${CMAKE_LINKER} -dll --entry 0 -nostdlib -o ${WEVT_DLL_FILE} ${WEVT_RES_OBJECT}
  2004. DEPENDS "${WEVT_GEN_SRC_C_FILE}" "${WEVT_GEN_SRC_H_FILE}"
  2005. COMMENT "Compiling ${WEVT_MC_FILE} to generate ${WEVT_MC_H_FILE} and ${WEVT_DLL_FILE}"
  2006. )
  2007. endif()
  2008. # Create a custom target for the DLL
  2009. add_custom_target(wevt_netdata ALL DEPENDS ${WEVT_DLL_FILE})
  2010. set_source_files_properties(src/libnetdata/log/nd_log-to-windows-events.c PROPERTIES
  2011. OBJECT_DEPENDS "${WEVT_MC_H_FILE}")
  2012. if(HAVE_ETW)
  2013. set_source_files_properties(src/libnetdata/log/nd_log-to-windows-events.c PROPERTIES
  2014. OBJECT_DEPENDS "${WEVT_MAN_H_FILE}")
  2015. install(FILES "${WEVT_DLL_FILE}" "${WEVT_MAN_FILE}" "${WEVT_ETW_INSTALL_SCRIPT}"
  2016. COMPONENT wevt_netdata_dll
  2017. DESTINATION "${BINDIR}")
  2018. else()
  2019. # do not install the manifest in this case
  2020. # the nsi installer will skip registering the ETW publisher
  2021. install(FILES "${WEVT_DLL_FILE}"
  2022. COMPONENT wevt_netdata_dll
  2023. DESTINATION "${BINDIR}")
  2024. endif()
  2025. endif()
  2026. endif()
  2027. # judy
  2028. target_link_libraries(libnetdata PUBLIC judy)
  2029. netdata_add_jsonc_to_target(libnetdata)
  2030. netdata_add_libyaml_to_target(libnetdata)
  2031. # jemalloc
  2032. if(ENABLE_JEMALLOC)
  2033. target_link_libraries(libnetdata PUBLIC ${JEMALLOC_LIBRARIES})
  2034. target_include_directories(libnetdata PUBLIC ${JEMALLOC_INCLUDE_DIRS})
  2035. target_compile_options(libnetdata PUBLIC ${JEMALLOC_CFLAGS_OTHER})
  2036. endif()
  2037. # libunwind
  2038. if(ENABLE_LIBUNWIND)
  2039. pkg_check_modules(LIBUNWIND libunwind IMPORTED_TARGET)
  2040. if(TARGET PkgConfig::LIBUNWIND)
  2041. set(HAVE_LIBUNWIND On)
  2042. if(CMAKE_SYSTEM_PROCESSOR MATCHES "(x86_64)|(amd64)")
  2043. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86_64)
  2044. elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i?.86")
  2045. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-x86)
  2046. elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "(arm64)|(aarch64)")
  2047. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-aarch64)
  2048. elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm")
  2049. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-arm)
  2050. elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "p(ower)?pc64")
  2051. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND -lunwind-ppc64)
  2052. else()
  2053. message(WARNING "Unknown architecture ${CMAKE_SYSTEM_PROCESSOR} for libunwind. Stack traces may not work.")
  2054. target_link_libraries(libnetdata PUBLIC PkgConfig::LIBUNWIND)
  2055. endif()
  2056. else()
  2057. message(FATAL "Could not find libunwind for logging of stack traces")
  2058. endif()
  2059. endif()
  2060. # zlib
  2061. if(OS_MACOS)
  2062. find_package(ZLIB REQUIRED)
  2063. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  2064. target_link_libraries(libnetdata PUBLIC ZLIB::ZLIB)
  2065. else()
  2066. pkg_check_modules(ZLIB REQUIRED zlib)
  2067. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  2068. target_compile_options(libnetdata PUBLIC ${ZLIB_CFLAGS_OTHER})
  2069. target_link_libraries(libnetdata PUBLIC ${ZLIB_LDFLAGS})
  2070. endif()
  2071. # lz4 - try to find a version that is compatible with streaming compression
  2072. # otherwise pick whichever one we can find to support dbengine but don't set
  2073. # ENABLE_LZ4.
  2074. pkg_check_modules(LIBLZ4 liblz4>=1.9.0)
  2075. if(LIBLZ4_FOUND)
  2076. set(ENABLE_LZ4 On)
  2077. else()
  2078. pkg_check_modules(LIBLZ4 REQUIRED liblz4)
  2079. endif()
  2080. target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
  2081. target_compile_options(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
  2082. target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
  2083. # zstd
  2084. pkg_check_modules(LIBZSTD libzstd)
  2085. if(LIBZSTD_FOUND)
  2086. set(ENABLE_ZSTD On)
  2087. target_include_directories(libnetdata BEFORE PUBLIC ${LIBZSTD_INCLUDE_DIRS})
  2088. target_compile_options(libnetdata PUBLIC ${LIBZSTD_CFLAGS_OTHER})
  2089. target_link_libraries(libnetdata PUBLIC ${LIBZSTD_LDFLAGS})
  2090. endif()
  2091. # brotli
  2092. pkg_check_modules(LIBBROTLI libbrotlidec libbrotlienc libbrotlicommon)
  2093. if(LIBBROTLI_FOUND)
  2094. set(ENABLE_BROTLI On)
  2095. target_include_directories(libnetdata PUBLIC ${LIBBROTLI_INCLUDE_DIRS})
  2096. target_compile_options(libnetdata PUBLIC ${LIBBROTLI_CFLAGS_OTHER})
  2097. target_link_libraries(libnetdata PUBLIC ${LIBBROTLI_LDFLAGS})
  2098. endif()
  2099. # uuid
  2100. if(OS_MACOS OR OS_WINDOWS)
  2101. # UUID functionality is part of the system libraries here, so no extra
  2102. # stuff needed.
  2103. else()
  2104. pkg_check_modules(UUID REQUIRED uuid)
  2105. target_include_directories(libnetdata BEFORE PUBLIC ${UUID_INCLUDE_DIRS})
  2106. target_compile_options(libnetdata PUBLIC ${UUID_CFLAGS_OTHER})
  2107. target_link_libraries(libnetdata PUBLIC ${UUID_LDFLAGS})
  2108. endif()
  2109. # uv
  2110. pkg_check_modules(LIBUV REQUIRED libuv)
  2111. target_include_directories(libnetdata BEFORE PUBLIC ${LIBUV_INCLUDE_DIRS})
  2112. target_compile_options(libnetdata PUBLIC ${LIBUV_CFLAGS_OTHER})
  2113. target_link_libraries(libnetdata PUBLIC ${LIBUV_LDFLAGS})
  2114. # crypto
  2115. target_link_libraries(libnetdata PUBLIC PkgConfig::CRYPTO)
  2116. # openssl
  2117. target_link_libraries(libnetdata PUBLIC PkgConfig::TLS)
  2118. # mnl
  2119. if(NOT OS_MACOS)
  2120. pkg_check_modules(MNL libmnl)
  2121. if(MNL_FOUND)
  2122. set(HAVE_LIBMNL True)
  2123. endif()
  2124. endif()
  2125. #
  2126. # mqtt library
  2127. #
  2128. set(ENABLE_MQTTWEBSOCKETS True)
  2129. if(ENABLE_MQTTWEBSOCKETS)
  2130. add_library(mqttwebsockets STATIC ${MQTT_WEBSOCKETS_FILES})
  2131. target_compile_options(mqttwebsockets PUBLIC -DMQTT_WSS_CUSTOM_ALLOC
  2132. -DRBUF_CUSTOM_MALLOC
  2133. -DMQTT_WSS_CPUSTATS)
  2134. target_include_directories(mqttwebsockets PUBLIC ${CMAKE_SOURCE_DIR}/aclk/helpers
  2135. ${CMAKE_SOURCE_DIR}/src/web/server/h2o/libh2o/include)
  2136. target_link_libraries(mqttwebsockets PRIVATE libnetdata)
  2137. endif()
  2138. #
  2139. # proto definitions
  2140. #
  2141. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  2142. "${CMAKE_BINARY_DIR}/src/aclk/aclk-schemas"
  2143. ACLK_PROTO_BUILT_SRCS
  2144. ACLK_PROTO_BUILT_HDRS
  2145. ${ACLK_PROTO_DEFS})
  2146. list(APPEND ACLK_FILES ${ACLK_PROTO_BUILT_SRCS}
  2147. ${ACLK_PROTO_BUILT_HDRS})
  2148. #
  2149. # build plugins
  2150. #
  2151. if(ENABLE_PLUGIN_DEBUGFS)
  2152. # Check for libcap (optional)
  2153. pkg_check_modules(CAP QUIET libcap)
  2154. # Define debugfs.plugin source files
  2155. set(DEBUGFS_PLUGIN_FILES
  2156. src/collectors/debugfs.plugin/debugfs_plugin.c
  2157. src/collectors/debugfs.plugin/debugfs_plugin.h
  2158. src/collectors/debugfs.plugin/module-numa-extfrag.c
  2159. src/collectors/debugfs.plugin/module-zswap.c
  2160. src/collectors/debugfs.plugin/module-devices-powercap.c
  2161. src/collectors/debugfs.plugin/module-libsensors.c
  2162. )
  2163. # Add executable for debugfs.plugin
  2164. add_executable(debugfs.plugin ${DEBUGFS_PLUGIN_FILES})
  2165. # Add vendored libsensors library
  2166. add_subdirectory(src/collectors/debugfs.plugin/libsensors)
  2167. # Link debugfs.plugin with vendored libsensors
  2168. target_link_libraries(debugfs.plugin PRIVATE vendored_libsensors)
  2169. # Include vendored libsensors headers
  2170. target_include_directories(debugfs.plugin PRIVATE
  2171. src/collectors/debugfs.plugin/libsensors/vendored/lib
  2172. ${CMAKE_CURRENT_BINARY_DIR}/src/collectors/debugfs.plugin/libsensors # For generated headers
  2173. )
  2174. # Link against libnetdata and optionally libcap
  2175. target_link_libraries(debugfs.plugin PRIVATE libnetdata ${CAP_LIBRARIES})
  2176. target_include_directories(debugfs.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  2177. target_compile_options(debugfs.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  2178. # Install the debugfs.plugin binary
  2179. install(TARGETS debugfs.plugin
  2180. COMPONENT plugin-debugfs
  2181. DESTINATION usr/libexec/netdata/plugins.d)
  2182. install(FILES
  2183. src/collectors/debugfs.plugin/libsensors/vendored/etc/sensors.conf.default
  2184. COMPONENT plugin-debugfs
  2185. DESTINATION usr/lib/netdata/conf.d
  2186. RENAME sensors3.conf)
  2187. # Install additional packaging files if building for packaging
  2188. if(BUILD_FOR_PACKAGING)
  2189. install(FILES
  2190. ${PKG_FILES_PATH}/copyright
  2191. COMPONENT plugin-debugfs
  2192. DESTINATION usr/share/doc/netdata-plugin-debugfs)
  2193. endif()
  2194. endif()
  2195. add_executable(spawn-tester src/libnetdata/spawn_server/spawn-tester.c)
  2196. target_link_libraries(spawn-tester libnetdata)
  2197. if(ENABLE_PLUGIN_APPS)
  2198. pkg_check_modules(CAP QUIET libcap)
  2199. set(APPS_PLUGIN_FILES
  2200. src/collectors/apps.plugin/apps_plugin.c
  2201. src/collectors/apps.plugin/apps_plugin.h
  2202. src/collectors/apps.plugin/apps_functions.c
  2203. src/collectors/apps.plugin/apps_targets.c
  2204. src/collectors/apps.plugin/apps_output.c
  2205. src/collectors/apps.plugin/apps_pid_files.c
  2206. src/collectors/apps.plugin/apps_pid.c
  2207. src/collectors/apps.plugin/apps_aggregations.c
  2208. src/collectors/apps.plugin/apps_os_linux.c
  2209. src/collectors/apps.plugin/apps_os_freebsd.c
  2210. src/collectors/apps.plugin/apps_os_macos.c
  2211. src/collectors/apps.plugin/apps_os_windows.c
  2212. src/collectors/apps.plugin/apps_incremental_collection.c
  2213. src/collectors/apps.plugin/apps_os_windows_nt.c
  2214. src/collectors/apps.plugin/apps_pid_match.c
  2215. )
  2216. add_executable(apps.plugin ${APPS_PLUGIN_FILES})
  2217. target_link_libraries(apps.plugin libnetdata ${CAP_LIBRARIES}
  2218. "$<$<BOOL:${OS_WINDOWS}>:Version;ntdll>")
  2219. target_include_directories(apps.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  2220. target_compile_options(apps.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  2221. install(TARGETS apps.plugin
  2222. COMPONENT plugin-apps
  2223. DESTINATION usr/libexec/netdata/plugins.d)
  2224. install(FILES src/collectors/apps.plugin/apps_groups.conf
  2225. COMPONENT plugin-apps
  2226. DESTINATION usr/lib/netdata/conf.d)
  2227. if(BUILD_FOR_PACKAGING)
  2228. install(FILES
  2229. ${PKG_FILES_PATH}/copyright
  2230. COMPONENT plugin-apps
  2231. DESTINATION usr/share/doc/netdata-plugin-apps)
  2232. endif()
  2233. endif()
  2234. if(CAP_FOUND)
  2235. set(HAVE_CAPABILITY True)
  2236. endif()
  2237. if(ENABLE_PLUGIN_FREEIPMI)
  2238. pkg_check_modules(IPMI REQUIRED libipmimonitoring)
  2239. set(FREEIPMI_PLUGIN_FILES src/collectors/freeipmi.plugin/freeipmi_plugin.c)
  2240. add_executable(freeipmi.plugin ${FREEIPMI_PLUGIN_FILES})
  2241. target_link_libraries (freeipmi.plugin libnetdata ${IPMI_LIBRARIES})
  2242. target_include_directories(freeipmi.plugin PRIVATE ${IPMI_INCLUDE_DIRS})
  2243. target_compile_options(freeipmi.plugin PRIVATE ${IPMI_CFLAGS_OTHER})
  2244. install(TARGETS freeipmi.plugin
  2245. COMPONENT plugin-freeipmi
  2246. DESTINATION usr/libexec/netdata/plugins.d)
  2247. if(BUILD_FOR_PACKAGING)
  2248. install(FILES
  2249. ${PKG_FILES_PATH}/copyright
  2250. COMPONENT plugin-freeipmi
  2251. DESTINATION usr/share/doc/netdata-plugin-freeipmi)
  2252. endif()
  2253. endif()
  2254. if(ENABLE_PLUGIN_NFACCT)
  2255. if (NOT MNL_FOUND)
  2256. message(FATAL_ERROR "Can not build nfacct.plugin because MNL library could not be found.")
  2257. endif()
  2258. pkg_check_modules(NFACCT REQUIRED libnetfilter_acct)
  2259. set(NFACCT_PLUGIN_FILES src/collectors/nfacct.plugin/plugin_nfacct.c)
  2260. add_executable(nfacct.plugin ${NFACCT_PLUGIN_FILES})
  2261. target_link_libraries (nfacct.plugin libnetdata ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  2262. target_include_directories(nfacct.plugin PRIVATE ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  2263. target_compile_options(nfacct.plugin PRIVATE ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  2264. install(TARGETS nfacct.plugin
  2265. COMPONENT plugin-nfacct
  2266. DESTINATION usr/libexec/netdata/plugins.d)
  2267. if(BUILD_FOR_PACKAGING)
  2268. install(FILES
  2269. ${PKG_FILES_PATH}/copyright
  2270. COMPONENT plugin-nfacct
  2271. DESTINATION usr/share/doc/netdata-plugin-nfacct)
  2272. endif()
  2273. endif()
  2274. if(ENABLE_PLUGIN_XENSTAT)
  2275. pkg_check_modules(XENSTAT REQUIRED xenstat)
  2276. pkg_check_modules(XENLIGHT REQUIRED xenlight)
  2277. set(XENSTAT_PLUGIN_FILES src/collectors/xenstat.plugin/xenstat_plugin.c)
  2278. add_executable(xenstat.plugin ${XENSTAT_PLUGIN_FILES})
  2279. target_link_libraries (xenstat.plugin libnetdata ${XENLIGHT_LIBRARIES} ${XENSTAT_LIBRARIES})
  2280. target_include_directories(xenstat.plugin PRIVATE ${XENLIGHT_INCLUDE_DIRS} ${XENSTAT_INCLUDE_DIRS})
  2281. target_compile_options(xenstat.plugin PRIVATE ${XENLIGHT_CFLAGS_OTHER} ${XENSTAT_CFLAGS_OTHER})
  2282. install(TARGETS xenstat.plugin
  2283. COMPONENT plugin-xenstat
  2284. DESTINATION usr/libexec/netdata/plugins.d)
  2285. if(BUILD_FOR_PACKAGING)
  2286. install(FILES
  2287. ${PKG_FILES_PATH}/copyright
  2288. COMPONENT plugin-xenstat
  2289. DESTINATION usr/share/doc/netdata-plugin-xenstat)
  2290. endif()
  2291. endif()
  2292. if(ENABLE_PLUGIN_PERF)
  2293. set(PERF_PLUGIN_FILES src/collectors/perf.plugin/perf_plugin.c)
  2294. add_executable(perf.plugin ${PERF_PLUGIN_FILES})
  2295. target_link_libraries(perf.plugin libnetdata)
  2296. install(TARGETS perf.plugin
  2297. COMPONENT plugin-perf
  2298. DESTINATION usr/libexec/netdata/plugins.d)
  2299. if(BUILD_FOR_PACKAGING)
  2300. install(FILES
  2301. ${PKG_FILES_PATH}/copyright
  2302. COMPONENT plugin-perf
  2303. DESTINATION usr/share/doc/netdata-plugin-perf)
  2304. endif()
  2305. endif()
  2306. if(ENABLE_PLUGIN_SLABINFO)
  2307. set(SLABINFO_PLUGIN_FILES src/collectors/slabinfo.plugin/slabinfo.c)
  2308. add_executable(slabinfo.plugin ${SLABINFO_PLUGIN_FILES})
  2309. target_link_libraries(slabinfo.plugin libnetdata)
  2310. install(TARGETS slabinfo.plugin
  2311. COMPONENT plugin-slabinfo
  2312. DESTINATION usr/libexec/netdata/plugins.d)
  2313. if(BUILD_FOR_PACKAGING)
  2314. install(FILES
  2315. ${PKG_FILES_PATH}/copyright
  2316. COMPONENT plugin-slabinfo
  2317. DESTINATION usr/share/doc/netdata-plugin-slabinfo)
  2318. endif()
  2319. endif()
  2320. if(ENABLE_PLUGIN_CUPS)
  2321. pkg_check_modules(CUPS libcups)
  2322. if(NOT CUPS_FOUND)
  2323. pkg_check_modules(CUPS cups)
  2324. if(NOT CUPS_FOUND)
  2325. find_program(CUPS_CONFIG cups-config)
  2326. if(CUPS_CONFIG)
  2327. execute_process(COMMAND ${CUPS_CONFIG} --api-version OUTPUT_VARIABLE CUPS_API_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
  2328. if(CUPS_API_VERSION VERSION_LESS "1.7")
  2329. set(CUPS_FOUND False)
  2330. else()
  2331. execute_process(COMMAND ${CUPS_CONFIG} --cflags OUTPUT_VARIABLE CUPS_CFLAGS_OTHER OUTPUT_STRIP_TRAILING_WHITESPACE)
  2332. execute_process(COMMAND ${CUPS_CONFIG} --libs OUTPUT_VARIABLE CUPS_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
  2333. set(CUPS_FOUND True)
  2334. endif()
  2335. endif()
  2336. endif()
  2337. endif()
  2338. if(NOT CUPS_FOUND)
  2339. message(WARNING "Could not find cups cflags and libs.")
  2340. else()
  2341. set(CUPS_PLUGIN_FILES src/collectors/cups.plugin/cups_plugin.c)
  2342. add_executable(cups.plugin ${CUPS_PLUGIN_FILES})
  2343. target_link_libraries (cups.plugin libnetdata ${CUPS_LIBRARIES})
  2344. target_compile_options(cups.plugin PRIVATE ${CUPS_CFLAGS_OTHER})
  2345. install(TARGETS cups.plugin
  2346. COMPONENT plugin-cups
  2347. DESTINATION usr/libexec/netdata/plugins.d)
  2348. if(BUILD_FOR_PACKAGING)
  2349. install(FILES
  2350. ${PKG_FILES_PATH}/copyright
  2351. COMPONENT plugin-cups
  2352. DESTINATION usr/share/doc/netdata-plugin-cups)
  2353. endif()
  2354. endif()
  2355. endif()
  2356. if(NEED_NDSUDO)
  2357. set(NDSUDO_FILES src/collectors/utils/ndsudo.c)
  2358. add_executable(ndsudo ${NDSUDO_FILES})
  2359. install(TARGETS ndsudo
  2360. COMPONENT netdata
  2361. DESTINATION usr/libexec/netdata/plugins.d)
  2362. endif()
  2363. if(ENABLE_PLUGIN_CGROUP_NETWORK)
  2364. set(CGROUP_NETWORK_FILES src/collectors/cgroups.plugin/cgroup-network.c)
  2365. add_executable(cgroup-network ${CGROUP_NETWORK_FILES})
  2366. target_link_libraries(cgroup-network libnetdata)
  2367. install(TARGETS cgroup-network
  2368. COMPONENT netdata
  2369. DESTINATION usr/libexec/netdata/plugins.d)
  2370. endif()
  2371. if(ENABLE_PLUGIN_SYSTEMD_JOURNAL)
  2372. if(NOT SYSTEMD_FOUND)
  2373. message(FATAL_ERROR "Systemd journal plugin requires systemd, but systemd was not found.")
  2374. endif()
  2375. add_executable(systemd-journal.plugin ${SYSTEMD_JOURNAL_PLUGIN_FILES})
  2376. target_link_libraries(systemd-journal.plugin libnetdata)
  2377. install(TARGETS systemd-journal.plugin
  2378. COMPONENT plugin-systemd-journal
  2379. DESTINATION usr/libexec/netdata/plugins.d)
  2380. if(BUILD_FOR_PACKAGING)
  2381. install(FILES
  2382. ${PKG_FILES_PATH}/copyright
  2383. COMPONENT plugin-systemd-journal
  2384. DESTINATION usr/share/doc/netdata-plugin-systemd-journal)
  2385. endif()
  2386. endif()
  2387. if(OS_WINDOWS)
  2388. add_executable(windows-events.plugin ${WINDOWS_EVENTS_PLUGIN_FILES})
  2389. target_link_libraries(windows-events.plugin libnetdata wevtapi)
  2390. install(TARGETS windows-events.plugin
  2391. COMPONENT plugin-windows-events
  2392. DESTINATION usr/libexec/netdata/plugins.d)
  2393. endif()
  2394. if(ENABLE_PLUGIN_EBPF)
  2395. set(EBPF_PLUGIN_FILES
  2396. src/collectors/ebpf.plugin/ebpf.c
  2397. src/collectors/ebpf.plugin/ebpf.h
  2398. src/collectors/ebpf.plugin/ebpf_cachestat.c
  2399. src/collectors/ebpf.plugin/ebpf_cachestat.h
  2400. src/collectors/ebpf.plugin/ebpf_dcstat.c
  2401. src/collectors/ebpf.plugin/ebpf_dcstat.h
  2402. src/collectors/ebpf.plugin/ebpf_disk.c
  2403. src/collectors/ebpf.plugin/ebpf_disk.h
  2404. src/collectors/ebpf.plugin/ebpf_fd.c
  2405. src/collectors/ebpf.plugin/ebpf_fd.h
  2406. src/collectors/ebpf.plugin/ebpf_hardirq.c
  2407. src/collectors/ebpf.plugin/ebpf_hardirq.h
  2408. src/collectors/ebpf.plugin/ebpf_mdflush.c
  2409. src/collectors/ebpf.plugin/ebpf_mdflush.h
  2410. src/collectors/ebpf.plugin/ebpf_mount.c
  2411. src/collectors/ebpf.plugin/ebpf_mount.h
  2412. src/collectors/ebpf.plugin/ebpf_filesystem.c
  2413. src/collectors/ebpf.plugin/ebpf_filesystem.h
  2414. src/collectors/ebpf.plugin/ebpf_oomkill.c
  2415. src/collectors/ebpf.plugin/ebpf_oomkill.h
  2416. src/collectors/ebpf.plugin/ebpf_process.c
  2417. src/collectors/ebpf.plugin/ebpf_process.h
  2418. src/collectors/ebpf.plugin/ebpf_shm.c
  2419. src/collectors/ebpf.plugin/ebpf_shm.h
  2420. src/collectors/ebpf.plugin/ebpf_socket.c
  2421. src/collectors/ebpf.plugin/ebpf_socket.h
  2422. src/collectors/ebpf.plugin/ebpf_softirq.c
  2423. src/collectors/ebpf.plugin/ebpf_softirq.h
  2424. src/collectors/ebpf.plugin/ebpf_sync.c
  2425. src/collectors/ebpf.plugin/ebpf_sync.h
  2426. src/collectors/ebpf.plugin/ebpf_swap.c
  2427. src/collectors/ebpf.plugin/ebpf_swap.h
  2428. src/collectors/ebpf.plugin/ebpf_vfs.c
  2429. src/collectors/ebpf.plugin/ebpf_vfs.h
  2430. src/collectors/ebpf.plugin/ebpf_apps.c
  2431. src/collectors/ebpf.plugin/ebpf_apps.h
  2432. src/collectors/ebpf.plugin/ebpf_cgroup.c
  2433. src/collectors/ebpf.plugin/ebpf_cgroup.h
  2434. src/collectors/ebpf.plugin/ebpf_unittest.c
  2435. src/collectors/ebpf.plugin/ebpf_unittest.h
  2436. src/collectors/ebpf.plugin/ebpf_functions.c
  2437. src/collectors/ebpf.plugin/ebpf_functions.h
  2438. src/collectors/ebpf.plugin/libbpf_api/ebpf.c
  2439. src/collectors/ebpf.plugin/libbpf_api/ebpf.h
  2440. )
  2441. add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
  2442. target_link_libraries(ebpf.plugin libnetdata)
  2443. netdata_add_libbpf_to_target(ebpf.plugin)
  2444. netdata_add_ebpf_co_re_to_target(ebpf.plugin)
  2445. install(TARGETS ebpf.plugin
  2446. COMPONENT plugin-ebpf
  2447. DESTINATION usr/libexec/netdata/plugins.d)
  2448. install(FILES
  2449. src/collectors/ebpf.plugin/ebpf.d.conf
  2450. COMPONENT plugin-ebpf
  2451. DESTINATION usr/lib/netdata/conf.d)
  2452. install(FILES
  2453. src/collectors/ebpf.plugin/ebpf.d/cachestat.conf
  2454. src/collectors/ebpf.plugin/ebpf.d/dcstat.conf
  2455. src/collectors/ebpf.plugin/ebpf.d/disk.conf
  2456. src/collectors/ebpf.plugin/ebpf.d/ebpf_kernel_reject_list.txt
  2457. src/collectors/ebpf.plugin/ebpf.d/fd.conf
  2458. src/collectors/ebpf.plugin/ebpf.d/filesystem.conf
  2459. src/collectors/ebpf.plugin/ebpf.d/hardirq.conf
  2460. src/collectors/ebpf.plugin/ebpf.d/mdflush.conf
  2461. src/collectors/ebpf.plugin/ebpf.d/mount.conf
  2462. src/collectors/ebpf.plugin/ebpf.d/network.conf
  2463. src/collectors/ebpf.plugin/ebpf.d/oomkill.conf
  2464. src/collectors/ebpf.plugin/ebpf.d/process.conf
  2465. src/collectors/ebpf.plugin/ebpf.d/shm.conf
  2466. src/collectors/ebpf.plugin/ebpf.d/softirq.conf
  2467. src/collectors/ebpf.plugin/ebpf.d/swap.conf
  2468. src/collectors/ebpf.plugin/ebpf.d/sync.conf
  2469. src/collectors/ebpf.plugin/ebpf.d/vfs.conf
  2470. COMPONENT plugin-ebpf
  2471. DESTINATION usr/lib/netdata/conf.d/ebpf.d)
  2472. if(BUILD_FOR_PACKAGING)
  2473. install(FILES
  2474. ${PKG_FILES_PATH}/copyright
  2475. COMPONENT plugin-ebpf
  2476. DESTINATION usr/share/doc/netdata-plugin-ebpf)
  2477. endif()
  2478. if(ENABLE_LEGACY_EBPF_PROGRAMS)
  2479. netdata_install_legacy_ebpf_code()
  2480. endif()
  2481. endif()
  2482. if(ENABLE_PLUGIN_LOCAL_LISTENERS)
  2483. set(LOCAL_LISTENERS_FILES
  2484. src/collectors/utils/local_listeners.c
  2485. src/libnetdata/local-sockets/local-sockets.h
  2486. )
  2487. add_executable(local-listeners ${LOCAL_LISTENERS_FILES})
  2488. target_compile_options(local-listeners PRIVATE
  2489. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  2490. target_include_directories(local-listeners PRIVATE
  2491. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  2492. target_link_libraries(local-listeners libnetdata
  2493. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  2494. install(TARGETS local-listeners
  2495. COMPONENT netdata
  2496. DESTINATION usr/libexec/netdata/plugins.d)
  2497. endif()
  2498. if(ENABLE_PLUGIN_NETWORK_VIEWER)
  2499. set(NETWORK_VIEWER_FILES
  2500. src/libnetdata/local-sockets/local-sockets.h
  2501. src/collectors/network-viewer.plugin/network-viewer.c
  2502. )
  2503. add_executable(network-viewer.plugin ${NETWORK_VIEWER_FILES})
  2504. target_compile_options(network-viewer.plugin PRIVATE
  2505. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  2506. target_include_directories(network-viewer.plugin PRIVATE
  2507. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  2508. target_link_libraries(network-viewer.plugin libnetdata
  2509. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  2510. install(TARGETS network-viewer.plugin
  2511. COMPONENT plugin-network-viewer
  2512. DESTINATION usr/libexec/netdata/plugins.d)
  2513. if(BUILD_FOR_PACKAGING)
  2514. install(FILES
  2515. ${PKG_FILES_PATH}/copyright
  2516. COMPONENT plugin-network-viewer
  2517. DESTINATION usr/share/doc/netdata-plugin-network-viewer)
  2518. endif()
  2519. endif()
  2520. #
  2521. # exporters
  2522. #
  2523. if(ENABLE_EXPORTER_MONGODB)
  2524. pkg_check_modules(MONGOC libmongoc-1.0>=1.7)
  2525. if(MONGOC_FOUND)
  2526. SET(HAVE_MONGOC True)
  2527. else()
  2528. SET(ENABLE_EXPORTER_MONGODB False)
  2529. endif()
  2530. endif()
  2531. if(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  2532. pkg_check_modules(SNAPPY snappy)
  2533. if (NOT SNAPPY_FOUND)
  2534. include(CheckLibraryExists)
  2535. check_library_exists(snappy snappy_compress "" HAVE_SNAPPY_LIB)
  2536. if(HAVE_SNAPPY_LIB)
  2537. set(SNAPPY_INCLUDE_DIRS "")
  2538. set(SNAPPY_CFLAGS_OTHER "")
  2539. set(SNAPPY_LIBRARIES "-lsnappy")
  2540. else()
  2541. message(FATAL_ERROR "Could not find snappy libraries with pkg-config or internal cmake checks.")
  2542. endif()
  2543. endif()
  2544. netdata_protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  2545. "${CMAKE_BINARY_DIR}/src/exporting/prometheus/remote_write"
  2546. PROMETHEUS_REMOTE_WRITE_BUILT_SRCS
  2547. PROMETHEUS_REMOTE_WRITE_BUILT_HDRS
  2548. "src/exporting/prometheus/remote_write/remote_write.proto")
  2549. list(APPEND PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  2550. ${PROMETHEUS_REMOTE_WRITE_BUILT_SRCS}
  2551. ${PROMETHEUS_REMOTE_WRITE_BUILT_HDRS})
  2552. set(ENABLE_PROMETHEUS_REMOTE_WRITE True)
  2553. endif()
  2554. #
  2555. # build netdata (only Linux ATM)
  2556. #
  2557. if(OS_WINDOWS)
  2558. set(NETDATA_CLAIM_RES_FILES "packaging/windows/resources/netdata_claim.rc")
  2559. configure_file(packaging/windows/resources/netdata_claim.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata_claim.manifest @ONLY)
  2560. set(NETDATACLI_RES_FILES "packaging/windows/resources/netdatacli.rc")
  2561. configure_file(packaging/windows/resources/netdatacli.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdatacli.manifest @ONLY)
  2562. set(NETDATA_RES_FILES "packaging/windows/resources/netdata.rc")
  2563. configure_file(packaging/windows/resources/netdata.manifest.in ${CMAKE_SOURCE_DIR}/packaging/windows/resources/netdata.manifest @ONLY)
  2564. configure_file(packaging/windows/netdata.wxs.in netdata.wxs @ONLY)
  2565. configure_file(packaging/windows/NetdataWhite.ico NetdataWhite.ico COPYONLY)
  2566. configure_file(packaging/windows/gpl-3.0.rtf gpl-3.0.rtf COPYONLY)
  2567. configure_file(packaging/windows/ncul1.rtf ncul1.rtf COPYONLY)
  2568. configure_file(packaging/windows/Top.bmp Top.bmp COPYONLY)
  2569. configure_file(packaging/windows/BackGround.bmp BackGround.bmp COPYONLY)
  2570. endif()
  2571. add_executable(netdata
  2572. ${NETDATA_FILES}
  2573. "${ACLK_FILES}"
  2574. "$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
  2575. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
  2576. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
  2577. "$<$<BOOL:${OS_WINDOWS}>:${NETDATA_RES_FILES}>"
  2578. )
  2579. if(OS_WINDOWS)
  2580. add_executable(NetdataClaim ${CLAIM_WINDOWS_FILES} ${NETDATA_CLAIM_RES_FILES})
  2581. target_link_libraries(NetdataClaim shell32 gdi32 msftedit)
  2582. target_compile_options(NetdataClaim PUBLIC -mwindows)
  2583. endif()
  2584. target_compile_definitions(netdata PRIVATE
  2585. "$<$<BOOL:${ENABLE_ML}>:DLIB_NO_GUI_SUPPORT>"
  2586. )
  2587. target_compile_options(netdata PRIVATE
  2588. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_CFLAGS_OTHER}>"
  2589. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_CFLAGS_OTHER}>"
  2590. )
  2591. target_include_directories(netdata PRIVATE
  2592. "${CMAKE_BINARY_DIR}/src/aclk/aclk-schemas"
  2593. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_INCLUDE_DIRS}>"
  2594. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_INCLUDE_DIRS}>"
  2595. )
  2596. target_link_libraries(netdata PRIVATE
  2597. m
  2598. libnetdata
  2599. "$<$<BOOL:${OS_LINUX}>:rt>"
  2600. "$<$<BOOL:${ENABLE_MQTTWEBSOCKETS}>:mqttwebsockets>"
  2601. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_LIBRARIES}>"
  2602. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_LIBRARIES}>"
  2603. "$<$<BOOL:${OS_MACOS}>:${IOKIT};${FOUNDATION}>"
  2604. "$<$<BOOL:${ENABLE_SENTRY}>:sentry>"
  2605. "$<$<BOOL:${ENABLE_WEBRTC}>:LibDataChannel::LibDataChannelStatic>"
  2606. "$<$<BOOL:${ENABLE_H2O}>:h2o>"
  2607. "$<$<BOOL:${CURL_FOUND}>:PkgConfig::CURL>"
  2608. )
  2609. netdata_add_protobuf(netdata)
  2610. #
  2611. # build systemd-cat-native
  2612. #
  2613. set(SYSTEMD_CAT_NATIVE_FILES src/libnetdata/log/systemd-cat-native.c
  2614. src/libnetdata/log/systemd-cat-native.h)
  2615. add_executable(systemd-cat-native ${SYSTEMD_CAT_NATIVE_FILES})
  2616. target_link_libraries(systemd-cat-native
  2617. libnetdata
  2618. "$<$<BOOL:${CURL_FOUND}>:PkgConfig::CURL>"
  2619. )
  2620. install(TARGETS systemd-cat-native
  2621. COMPONENT netdata
  2622. DESTINATION "${BINDIR}")
  2623. #
  2624. # build log2journal
  2625. #
  2626. pkg_check_modules(PCRE2 libpcre2-8)
  2627. if(PCRE2_FOUND)
  2628. set(LOG2JOURNAL_FILES
  2629. ${CONFIG_H}
  2630. src/collectors/log2journal/log2journal.h
  2631. src/collectors/log2journal/log2journal.c
  2632. src/collectors/log2journal/log2journal-help.c
  2633. src/collectors/log2journal/log2journal-yaml.c
  2634. src/collectors/log2journal/log2journal-json.c
  2635. src/collectors/log2journal/log2journal-logfmt.c
  2636. src/collectors/log2journal/log2journal-pcre2.c
  2637. src/collectors/log2journal/log2journal-params.c
  2638. src/collectors/log2journal/log2journal-inject.c
  2639. src/collectors/log2journal/log2journal-pattern.c
  2640. src/collectors/log2journal/log2journal-replace.c
  2641. src/collectors/log2journal/log2journal-rename.c
  2642. src/collectors/log2journal/log2journal-rewrite.c
  2643. src/collectors/log2journal/log2journal-txt.h
  2644. src/collectors/log2journal/log2journal-hashed-key.h
  2645. )
  2646. add_executable(log2journal ${LOG2JOURNAL_FILES})
  2647. target_include_directories(log2journal BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src ${PCRE2_INCLUDE_DIRS})
  2648. target_compile_options(log2journal PUBLIC ${PCRE2_CFLAGS_OTHER})
  2649. target_link_libraries(log2journal PUBLIC libnetdata)
  2650. target_link_libraries(log2journal PUBLIC "${PCRE2_LDFLAGS}")
  2651. netdata_add_libyaml_to_target(log2journal)
  2652. install(TARGETS log2journal
  2653. COMPONENT netdata
  2654. DESTINATION "${BINDIR}")
  2655. install(DIRECTORY src/collectors/log2journal/log2journal.d
  2656. COMPONENT netdata
  2657. DESTINATION usr/lib/netdata/conf.d)
  2658. endif()
  2659. #
  2660. # build netdatacli
  2661. #
  2662. set(NETDATACLI_FILES
  2663. src/daemon/commands.h
  2664. src/daemon/pipename.c
  2665. src/daemon/pipename.h
  2666. src/cli/cli.c
  2667. )
  2668. add_executable(netdatacli ${NETDATACLI_FILES} "$<$<BOOL:${OS_WINDOWS}>:${NETDATACLI_RES_FILES}>")
  2669. target_link_libraries(netdatacli libnetdata)
  2670. install(TARGETS netdatacli
  2671. COMPONENT netdata
  2672. DESTINATION "${BINDIR}")
  2673. #
  2674. # Build go.d.plugin
  2675. #
  2676. if(ENABLE_PLUGIN_GO)
  2677. add_go_target(go-plugin go.d.plugin src/go cmd/godplugin)
  2678. install(PROGRAMS ${CMAKE_BINARY_DIR}/go.d.plugin
  2679. COMPONENT plugin-go
  2680. DESTINATION usr/libexec/netdata/plugins.d)
  2681. endif()
  2682. #
  2683. # Generate config file
  2684. #
  2685. if(NOT NETDATA_RUNTIME_PREFIX STREQUAL "")
  2686. string(REGEX REPLACE "/$" "" NETDATA_RUNTIME_PREFIX "${NETDATA_RUNTIME_PREFIX}")
  2687. endif()
  2688. set(CACHE_DIR "${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")
  2689. set(CONFIG_DIR "${NETDATA_RUNTIME_PREFIX}/etc/netdata")
  2690. set(LIBCONFIG_DIR "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")
  2691. set(LOG_DIR "${NETDATA_RUNTIME_PREFIX}/var/log/netdata")
  2692. set(PLUGINS_DIR "${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata/plugins.d")
  2693. set(VARLIB_DIR "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")
  2694. # A non-default value is only used when building Debian packages (/var/lib/netdata/www)
  2695. if(NOT DEFINED WEB_DIR)
  2696. set(WEB_DIR "usr/share/netdata/web")
  2697. else()
  2698. string(REGEX REPLACE "^/" "" WEB_DIR "${WEB_DIR}")
  2699. endif()
  2700. set(WEB_DEST "${WEB_DIR}")
  2701. set(WEB_DIR "${NETDATA_RUNTIME_PREFIX}/${WEB_DEST}")
  2702. # Collect all compiler flags
  2703. get_directory_property(NETDATA_COMPILE_OPTIONS COMPILE_OPTIONS)
  2704. get_directory_property(NETDATA_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
  2705. # Collect all linker flags
  2706. get_directory_property(NETDATA_LINK_OPTIONS LINK_OPTIONS)
  2707. get_directory_property(NETDATA_LINK_LIBRARIES LINK_LIBRARIES)
  2708. list(APPEND CONFIGURE_OPTIONS
  2709. # Build type and languages
  2710. "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
  2711. "-DCMAKE_C_STANDARD=${CMAKE_C_STANDARD}"
  2712. "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
  2713. "-DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS}"
  2714. # Compiler flags (dynamically collected)
  2715. "-DCMAKE_C_FLAGS='${CMAKE_C_FLAGS} ${NETDATA_COMPILE_OPTIONS}'"
  2716. "-DCMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS} ${NETDATA_COMPILE_OPTIONS}'"
  2717. "-DCMAKE_COMPILE_DEFINITIONS='${NETDATA_COMPILE_DEFINITIONS}'"
  2718. # Linker flags (dynamically collected)
  2719. "-DCMAKE_EXE_LINKER_FLAGS='${CMAKE_EXE_LINKER_FLAGS} ${NETDATA_LINK_OPTIONS}'"
  2720. "-DCMAKE_SHARED_LINKER_FLAGS='${CMAKE_SHARED_LINKER_FLAGS}'"
  2721. )
  2722. string(JOIN " " CONFIGURE_COMMAND "cmake" ${CONFIGURE_OPTIONS})
  2723. if (NOT NETDATA_USER)
  2724. set(NETDATA_USER "netdata")
  2725. endif()
  2726. set(BUILD_INFO_CMAKE_CACHE_ARCHIVE_NAME "build-info-cmake-cache.gz")
  2727. set(BUILD_INFO_CMAKE_CACHE_ARCHIVE_PATH "usr/share/netdata")
  2728. configure_file(packaging/cmake/config.cmake.h.in config.h)
  2729. #
  2730. # install
  2731. #
  2732. install(TARGETS netdata COMPONENT netdata DESTINATION "${BINDIR}")
  2733. install(DIRECTORY COMPONENT netdata DESTINATION var/cache/netdata)
  2734. install(DIRECTORY COMPONENT netdata DESTINATION var/log/netdata)
  2735. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/registry)
  2736. install(DIRECTORY COMPONENT netdata DESTINATION var/lib/netdata/cloud.d)
  2737. install(DIRECTORY COMPONENT netdata DESTINATION var/run/netdata)
  2738. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata)
  2739. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/custom-plugins.d)
  2740. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/health.d)
  2741. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/ssl)
  2742. install(DIRECTORY COMPONENT netdata DESTINATION etc/netdata/statsd.d)
  2743. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d)
  2744. install(DIRECTORY COMPONENT netdata DESTINATION usr/lib/netdata/conf.d/schema.d)
  2745. install(DIRECTORY COMPONENT netdata DESTINATION usr/libexec/netdata/plugins.d)
  2746. install(DIRECTORY COMPONENT netdata DESTINATION ${WEB_DEST})
  2747. set(libsysdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/system")
  2748. set(pkglibexecdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/libexec/netdata")
  2749. set(localstatedir_POST "${NETDATA_RUNTIME_PREFIX}/var")
  2750. set(sbindir_POST "${NETDATA_RUNTIME_PREFIX}/${BINDIR}")
  2751. set(configdir_POST "${NETDATA_RUNTIME_PREFIX}/etc/netdata")
  2752. set(libconfigdir_POST "${NETDATA_RUNTIME_PREFIX}/usr/lib/netdata/conf.d")
  2753. set(cachedir_POST "${NETDATA_RUNTIME_PREFIX}/var/cache/netdata")
  2754. set(registrydir_POST "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata/registry")
  2755. set(varlibdir_POST "${NETDATA_RUNTIME_PREFIX}/var/lib/netdata")
  2756. set(netdata_user_POST "${NETDATA_USER}")
  2757. set(netdata_group_POST "${NETDATA_USER}")
  2758. if(NOT OS_WINDOWS)
  2759. configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
  2760. install(PROGRAMS
  2761. ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
  2762. COMPONENT netdata
  2763. DESTINATION "${BINDIR}")
  2764. else()
  2765. install(PROGRAMS
  2766. ${CMAKE_BINARY_DIR}/NetdataClaim.exe
  2767. COMPONENT netdata
  2768. DESTINATION "${BINDIR}")
  2769. endif()
  2770. #
  2771. # We don't check ENABLE_PLUGIN_CGROUP_NETWORK because rpm builds assume
  2772. # the files exists unconditionally.
  2773. #
  2774. configure_file(src/collectors/cgroups.plugin/cgroup-network-helper.sh.in
  2775. src/collectors/cgroups.plugin/cgroup-network-helper.sh @ONLY)
  2776. install(PROGRAMS
  2777. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-network-helper.sh
  2778. COMPONENT netdata
  2779. DESTINATION usr/libexec/netdata/plugins.d)
  2780. configure_file(src/collectors/cgroups.plugin/cgroup-name.sh.in
  2781. src/collectors/cgroups.plugin/cgroup-name.sh @ONLY)
  2782. install(PROGRAMS
  2783. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-name.sh
  2784. COMPONENT netdata
  2785. DESTINATION usr/libexec/netdata/plugins.d)
  2786. #
  2787. # statsd
  2788. #
  2789. install(FILES
  2790. src/collectors/statsd.plugin/asterisk.conf
  2791. src/collectors/statsd.plugin/example.conf
  2792. src/collectors/statsd.plugin/k6.conf
  2793. COMPONENT netdata
  2794. DESTINATION usr/lib/netdata/conf.d/statsd.d)
  2795. #
  2796. # exporting
  2797. #
  2798. install(FILES
  2799. src/exporting/exporting.conf
  2800. COMPONENT netdata
  2801. DESTINATION usr/lib/netdata/conf.d)
  2802. #
  2803. # ioping.plugin
  2804. #
  2805. install(FILES
  2806. src/collectors/ioping.plugin/ioping.conf
  2807. COMPONENT netdata
  2808. DESTINATION usr/lib/netdata/conf.d)
  2809. #
  2810. # streaming
  2811. #
  2812. install(FILES
  2813. src/streaming/stream.conf
  2814. COMPONENT netdata
  2815. DESTINATION usr/lib/netdata/conf.d)
  2816. #
  2817. # swagger
  2818. #
  2819. install(FILES
  2820. src/web/api/netdata-swagger.json
  2821. src/web/api/netdata-swagger.yaml
  2822. COMPONENT netdata
  2823. DESTINATION ${WEB_DEST})
  2824. #
  2825. # service files
  2826. #
  2827. configure_file(system/install-service.sh.in system/install-service.sh @ONLY)
  2828. install(PROGRAMS
  2829. ${CMAKE_BINARY_DIR}/system/install-service.sh
  2830. COMPONENT netdata
  2831. DESTINATION usr/libexec/netdata)
  2832. configure_file(system/launchd/netdata.plist.in system/launchd/netdata.plist @ONLY)
  2833. install(FILES
  2834. ${CMAKE_BINARY_DIR}/system/launchd/netdata.plist
  2835. COMPONENT netdata
  2836. DESTINATION usr/lib/netdata/system/launchd)
  2837. configure_file(system/freebsd/rc.d/netdata.in system/freebsd/rc.d/netdata @ONLY)
  2838. install(FILES
  2839. ${CMAKE_BINARY_DIR}/system/freebsd/rc.d/netdata
  2840. COMPONENT netdata
  2841. DESTINATION usr/lib/netdata/system/freebsd/rc.d)
  2842. configure_file(system/initd/init.d/netdata.in system/initd/init.d/netdata @ONLY)
  2843. install(FILES
  2844. ${CMAKE_BINARY_DIR}/system/initd/init.d/netdata
  2845. COMPONENT netdata
  2846. DESTINATION usr/lib/netdata/system/initd/init.d)
  2847. configure_file(system/logrotate/netdata.in system/logrotate/netdata @ONLY)
  2848. install(FILES
  2849. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2850. COMPONENT netdata
  2851. DESTINATION usr/lib/netdata/system/logrotate)
  2852. install(FILES
  2853. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2854. COMPONENT netdata
  2855. DESTINATION etc/logrotate.d)
  2856. configure_file(system/lsb/init.d/netdata.in system/lsb/init.d/netdata @ONLY)
  2857. install(FILES
  2858. ${CMAKE_BINARY_DIR}/system/lsb/init.d/netdata
  2859. COMPONENT netdata
  2860. DESTINATION usr/lib/netdata/system/lsb/init.d)
  2861. configure_file(system/openrc/conf.d/netdata.in system/openrc/conf.d/netdata @ONLY)
  2862. install(FILES
  2863. ${CMAKE_BINARY_DIR}/system/openrc/conf.d/netdata
  2864. COMPONENT netdata
  2865. DESTINATION usr/lib/netdata/system/openrc/conf.d)
  2866. configure_file(system/openrc/init.d/netdata.in system/openrc/init.d/netdata @ONLY)
  2867. install(FILES
  2868. ${CMAKE_BINARY_DIR}/system/openrc/init.d/netdata
  2869. COMPONENT netdata
  2870. DESTINATION usr/lib/netdata/system/openrc/init.d)
  2871. configure_file(system/runit/run.in system/runit/run @ONLY)
  2872. install(FILES
  2873. ${CMAKE_BINARY_DIR}/system/runit/run
  2874. COMPONENT netdata
  2875. DESTINATION usr/lib/netdata/system/runit)
  2876. configure_file(system/dinit/netdata.in system/dinit/netdata @ONLY)
  2877. install(FILES
  2878. ${CMAKE_BINARY_DIR}/system/dinit/netdata
  2879. COMPONENT netdata
  2880. DESTINATION usr/lib/netdata/system/dinit)
  2881. configure_file(system/systemd/netdata.service.in system/systemd/netdata.service @ONLY)
  2882. install(FILES
  2883. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2884. COMPONENT netdata
  2885. DESTINATION usr/lib/netdata/system/systemd)
  2886. install(FILES
  2887. system/systemd/journald@netdata.conf
  2888. COMPONENT netdata
  2889. DESTINATION usr/lib/netdata/system/systemd)
  2890. configure_file(system/systemd/netdata.service.v235.in system/systemd/netdata.service.v235 @ONLY)
  2891. install(FILES
  2892. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service.v235
  2893. COMPONENT netdata
  2894. DESTINATION usr/lib/netdata/system/systemd)
  2895. if(BUILD_FOR_PACKAGING)
  2896. install(FILES
  2897. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2898. COMPONENT netdata
  2899. DESTINATION lib/systemd/system)
  2900. install(DIRECTORY
  2901. COMPONENT netdata
  2902. DESTINATION usr/lib/systemd/journald@netdata.conf.d)
  2903. install(FILES
  2904. system/systemd/journald@netdata.conf
  2905. COMPONENT netdata
  2906. DESTINATION usr/lib/systemd/journald@netdata.conf.d
  2907. RENAME netdata.conf)
  2908. endif()
  2909. install(FILES
  2910. system/systemd/50-netdata.preset
  2911. COMPONENT netdata
  2912. DESTINATION usr/lib/netdata/system/systemd)
  2913. install(FILES
  2914. system/vnodes/vnodes.conf
  2915. COMPONENT netdata
  2916. DESTINATION usr/lib/netdata/conf.d/vnodes)
  2917. install(FILES
  2918. system/.install-type
  2919. COMPONENT netdata
  2920. DESTINATION etc/netdata)
  2921. install(PROGRAMS
  2922. system/edit-config
  2923. COMPONENT netdata
  2924. DESTINATION etc/netdata)
  2925. if(BUILD_FOR_PACKAGING)
  2926. set(NETDATA_CONF_DEST "etc/netdata")
  2927. else()
  2928. set(NETDATA_CONF_DEST "usr/lib/netdata/conf.d")
  2929. endif()
  2930. #
  2931. # misc files
  2932. #
  2933. if(BUILD_FOR_PACKAGING)
  2934. install(FILES
  2935. ${PKG_FILES_PATH}/deb/netdata/etc/default/netdata
  2936. COMPONENT netdata
  2937. DESTINATION etc/default)
  2938. install(PROGRAMS
  2939. ${PKG_FILES_PATH}/deb/netdata/etc/init.d/netdata
  2940. COMPONENT netdata
  2941. DESTINATION etc/init.d)
  2942. endif()
  2943. if(NOT OS_WINDOWS)
  2944. install(PROGRAMS
  2945. packaging/installer/netdata-updater.sh
  2946. COMPONENT netdata
  2947. DESTINATION usr/libexec/netdata)
  2948. install(FILES
  2949. system/netdata.conf
  2950. system/netdata-updater.conf
  2951. COMPONENT netdata
  2952. DESTINATION ${NETDATA_CONF_DEST})
  2953. configure_file(system/cron/netdata-updater-daily.in
  2954. system/cron/netdata-updater-daily
  2955. @ONLY)
  2956. install(FILES
  2957. ${CMAKE_BINARY_DIR}/system/cron/netdata-updater-daily
  2958. COMPONENT netdata
  2959. DESTINATION usr/lib/netdata/system/cron)
  2960. configure_file(system/systemd/netdata-updater.service.in
  2961. system/systemd/netdata-updater.service
  2962. @ONLY)
  2963. install(FILES
  2964. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2965. COMPONENT netdata
  2966. DESTINATION usr/lib/netdata/system/systemd)
  2967. install(FILES
  2968. system/systemd/netdata-updater.timer
  2969. COMPONENT netdata
  2970. DESTINATION usr/lib/netdata/system/systemd)
  2971. if(BUILD_FOR_PACKAGING)
  2972. install(FILES
  2973. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2974. COMPONENT netdata
  2975. DESTINATION lib/systemd/system)
  2976. install(FILES
  2977. system/systemd/netdata-updater.timer
  2978. COMPONENT netdata
  2979. DESTINATION lib/systemd/system)
  2980. endif()
  2981. endif()
  2982. #
  2983. # TODO: check the following files for correct substitutions
  2984. #
  2985. configure_file(src/daemon/anonymous-statistics.sh.in src/daemon/anonymous-statistics.sh @ONLY)
  2986. install(PROGRAMS
  2987. ${CMAKE_BINARY_DIR}/src/daemon/anonymous-statistics.sh
  2988. COMPONENT netdata
  2989. DESTINATION usr/libexec/netdata/plugins.d)
  2990. configure_file(src/daemon/get-kubernetes-labels.sh.in src/daemon/get-kubernetes-labels.sh @ONLY)
  2991. install(PROGRAMS
  2992. ${CMAKE_BINARY_DIR}/src/daemon/get-kubernetes-labels.sh
  2993. COMPONENT netdata
  2994. DESTINATION usr/libexec/netdata/plugins.d)
  2995. install(PROGRAMS
  2996. src/daemon/system-info.sh
  2997. COMPONENT netdata
  2998. DESTINATION usr/libexec/netdata/plugins.d)
  2999. #
  3000. # health files
  3001. #
  3002. file(GLOB_RECURSE HEALTH_CONF_FILES "src/health/health.d/*.conf")
  3003. install(FILES
  3004. ${HEALTH_CONF_FILES}
  3005. COMPONENT netdata
  3006. DESTINATION usr/lib/netdata/conf.d/health.d)
  3007. configure_file(src/health/notifications/alarm-notify.sh.in src/health/notifications/alarm-notify.sh @ONLY)
  3008. install(PROGRAMS
  3009. ${CMAKE_BINARY_DIR}/src/health/notifications/alarm-notify.sh
  3010. COMPONENT netdata
  3011. DESTINATION usr/libexec/netdata/plugins.d)
  3012. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  3013. install(PROGRAMS
  3014. src/health/notifications/alarm-email.sh
  3015. src/health/notifications/alarm-test.sh
  3016. COMPONENT netdata
  3017. DESTINATION usr/libexec/netdata/plugins.d)
  3018. endif()
  3019. install(FILES
  3020. src/health/notifications/health_alarm_notify.conf
  3021. src/health/notifications/health_email_recipients.conf
  3022. COMPONENT netdata
  3023. DESTINATION usr/lib/netdata/conf.d)
  3024. #
  3025. # test/ files
  3026. #
  3027. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  3028. configure_file(tests/health_mgmtapi/health-cmdapi-test.sh.in tests/health_mgmtapi/health-cmdapi-test.sh @ONLY)
  3029. configure_file(tests/acls/acl.sh.in tests/acls/acl.sh @ONLY)
  3030. configure_file(tests/urls/request.sh.in tests/urls/request.sh @ONLY)
  3031. configure_file(tests/alarm_repetition/alarm.sh.in tests/alarm_repetition/alarm.sh @ONLY)
  3032. configure_file(tests/template_dimension/template_dim.sh.in tests/template_dimension/template_dim.sh @ONLY)
  3033. configure_file(tests/ebpf/ebpf_thread_function.sh.in tests/ebpf/ebpf_thread_function.sh @ONLY)
  3034. install(FILES
  3035. ${CMAKE_BINARY_DIR}/tests/health_mgmtapi/health-cmdapi-test.sh
  3036. ${CMAKE_BINARY_DIR}/tests/acls/acl.sh
  3037. ${CMAKE_BINARY_DIR}/tests/urls/request.sh
  3038. ${CMAKE_BINARY_DIR}/tests/alarm_repetition/alarm.sh
  3039. ${CMAKE_BINARY_DIR}/tests/template_dimension/template_dim.sh
  3040. ${CMAKE_BINARY_DIR}/tests/ebpf/ebpf_thread_function.sh
  3041. DESTINATION usr/libexec/netdata/plugins.d)
  3042. endif()
  3043. #
  3044. # charts.d plugin
  3045. #
  3046. if(ENABLE_PLUGIN_CHARTS)
  3047. install(DIRECTORY COMPONENT plugin-chartsd DESTINATION etc/netdata/charts.d)
  3048. configure_file(src/collectors/charts.d.plugin/charts.d.plugin.in src/collectors/charts.d.plugin/charts.d.plugin @ONLY)
  3049. install(PROGRAMS
  3050. ${CMAKE_BINARY_DIR}/src/collectors/charts.d.plugin/charts.d.plugin
  3051. COMPONENT plugin-chartsd
  3052. DESTINATION usr/libexec/netdata/plugins.d)
  3053. install(PROGRAMS
  3054. src/collectors/charts.d.plugin/charts.d.dryrun-helper.sh
  3055. COMPONENT plugin-chartsd
  3056. DESTINATION usr/libexec/netdata/plugins.d)
  3057. install(FILES
  3058. src/collectors/charts.d.plugin/charts.d.conf
  3059. COMPONENT plugin-chartsd
  3060. DESTINATION usr/lib/netdata/conf.d)
  3061. install(PROGRAMS
  3062. src/collectors/charts.d.plugin/example/example.chart.sh
  3063. src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
  3064. src/collectors/charts.d.plugin/opensips/opensips.chart.sh
  3065. COMPONENT plugin-chartsd
  3066. DESTINATION usr/libexec/netdata/charts.d)
  3067. install(FILES
  3068. src/collectors/charts.d.plugin/example/example.conf
  3069. src/collectors/charts.d.plugin/libreswan/libreswan.conf
  3070. src/collectors/charts.d.plugin/opensips/opensips.conf
  3071. COMPONENT plugin-chartsd
  3072. DESTINATION usr/lib/netdata/conf.d/charts.d)
  3073. if(BUILD_FOR_PACKAGING)
  3074. install(FILES
  3075. ${PKG_FILES_PATH}/copyright
  3076. COMPONENT plugin-chartsd
  3077. DESTINATION usr/share/doc/netdata-plugin-chartsd)
  3078. endif()
  3079. endif()
  3080. # This is needed both by the TC plugin (which only gets built on Linux) and the charts plugin.
  3081. if(OS_LINUX OR ENABLE_PLUGIN_CHARTS)
  3082. install(FILES
  3083. src/collectors/charts.d.plugin/loopsleepms.sh.inc
  3084. COMPONENT netdata
  3085. DESTINATION usr/libexec/netdata/plugins.d)
  3086. endif()
  3087. #
  3088. # tc-qos-helper
  3089. #
  3090. if(OS_LINUX)
  3091. configure_file(src/collectors/tc.plugin/tc-qos-helper.sh.in src/collectors/tc.plugin/tc-qos-helper.sh @ONLY)
  3092. install(PROGRAMS
  3093. ${CMAKE_BINARY_DIR}/src/collectors/tc.plugin/tc-qos-helper.sh
  3094. COMPONENT netdata
  3095. DESTINATION usr/libexec/netdata/plugins.d)
  3096. endif()
  3097. # confs
  3098. install(FILES
  3099. src/collectors/systemd-journal.plugin/schema.d/systemd-journal%3Amonitored-directories.json
  3100. src/health/schema.d/health%3Aalert%3Aprototype.json
  3101. COMPONENT netdata
  3102. DESTINATION usr/lib/netdata/conf.d/schema.d)
  3103. #
  3104. # python.d plugin
  3105. #
  3106. if(ENABLE_PLUGIN_PYTHON)
  3107. install(DIRECTORY COMPONENT plugin-pythond DESTINATION etc/netdata/python.d)
  3108. configure_file(src/collectors/python.d.plugin/python.d.plugin.in src/collectors/python.d.plugin/python.d.plugin @ONLY)
  3109. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/python.d.plugin/python.d.plugin
  3110. COMPONENT plugin-pythond
  3111. DESTINATION usr/libexec/netdata/plugins.d)
  3112. install(DIRECTORY src/collectors/python.d.plugin/python_modules
  3113. COMPONENT plugin-pythond
  3114. DESTINATION usr/libexec/netdata/python.d)
  3115. if(OS_WINDOWS)
  3116. include(NetdataUtil)
  3117. precompile_python(usr/libexec/netdata/python.d plugin-pythond)
  3118. endif()
  3119. install(FILES src/collectors/python.d.plugin/python.d.conf
  3120. COMPONENT plugin-pythond
  3121. DESTINATION usr/lib/netdata/conf.d)
  3122. install(FILES
  3123. src/collectors/python.d.plugin/am2320/am2320.conf
  3124. src/collectors/python.d.plugin/go_expvar/go_expvar.conf
  3125. src/collectors/python.d.plugin/haproxy/haproxy.conf
  3126. src/collectors/python.d.plugin/pandas/pandas.conf
  3127. src/collectors/python.d.plugin/traefik/traefik.conf
  3128. COMPONENT plugin-pythond
  3129. DESTINATION usr/lib/netdata/conf.d/python.d)
  3130. install(FILES
  3131. src/collectors/python.d.plugin/am2320/am2320.chart.py
  3132. src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
  3133. src/collectors/python.d.plugin/haproxy/haproxy.chart.py
  3134. src/collectors/python.d.plugin/pandas/pandas.chart.py
  3135. src/collectors/python.d.plugin/traefik/traefik.chart.py
  3136. COMPONENT plugin-pythond
  3137. DESTINATION usr/libexec/netdata/python.d)
  3138. if(BUILD_FOR_PACKAGING)
  3139. install(FILES
  3140. ${PKG_FILES_PATH}/copyright
  3141. COMPONENT plugin-pythond
  3142. DESTINATION usr/share/doc/netdata-plugin-pythond)
  3143. endif()
  3144. endif()
  3145. #
  3146. # ioping.plugin
  3147. #
  3148. configure_file(src/collectors/ioping.plugin/ioping.plugin.in src/collectors/ioping.plugin/ioping.plugin @ONLY)
  3149. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/ioping.plugin/ioping.plugin
  3150. COMPONENT netdata
  3151. DESTINATION usr/libexec/netdata/plugins.d)
  3152. #
  3153. # go.d.plugin
  3154. #
  3155. if(ENABLE_PLUGIN_GO)
  3156. install(DIRECTORY COMPONENT plugin-go DESTINATION etc/netdata/go.d)
  3157. install(FILES src/go/plugin/go.d/config/go.d.conf
  3158. COMPONENT plugin-go
  3159. DESTINATION usr/lib/netdata/conf.d)
  3160. install(DIRECTORY
  3161. COMPONENT plugin-go
  3162. DESTINATION usr/lib/netdata/conf.d/go.d)
  3163. file(GLOB GO_CONF_FILES src/go/plugin/go.d/config/go.d/*.conf)
  3164. install(FILES ${GO_CONF_FILES}
  3165. COMPONENT plugin-go
  3166. DESTINATION usr/lib/netdata/conf.d/go.d)
  3167. install(DIRECTORY
  3168. COMPONENT plugin-go
  3169. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  3170. file(GLOB GO_SD_CONF_FILES src/go/plugin/go.d/config/go.d/sd/*.conf)
  3171. install(FILES ${GO_SD_CONF_FILES}
  3172. COMPONENT plugin-go
  3173. DESTINATION usr/lib/netdata/conf.d/go.d/sd)
  3174. if(BUILD_FOR_PACKAGING)
  3175. install(FILES
  3176. ${PKG_FILES_PATH}/copyright
  3177. COMPONENT plugin-go
  3178. DESTINATION usr/share/doc/netdata-plugin-go)
  3179. endif()
  3180. endif()
  3181. #
  3182. # dashboard
  3183. #
  3184. if(ENABLE_DASHBOARD)
  3185. include(NetdataDashboard)
  3186. bundle_dashboard()
  3187. install(FILES
  3188. src/web/gui/ilove.html
  3189. COMPONENT dashboard
  3190. DESTINATION ${WEB_DEST})
  3191. endif()
  3192. #
  3193. # Ship CMakeCache.txt as an archive
  3194. #
  3195. install(CODE "
  3196. execute_process(COMMAND gzip -c \"${CMAKE_BINARY_DIR}/CMakeCache.txt\"
  3197. OUTPUT_FILE \"${BUILD_INFO_CMAKE_CACHE_ARCHIVE_NAME}\"
  3198. WORKING_DIRECTORY \"${CMAKE_BINARY_DIR}\"
  3199. RESULT_VARIABLE result)
  3200. if(NOT result EQUAL 0)
  3201. message(WARNING \"Failed to compress CMakeCache.txt\")
  3202. endif()
  3203. file(INSTALL \"${CMAKE_BINARY_DIR}/${BUILD_INFO_CMAKE_CACHE_ARCHIVE_NAME}\"
  3204. DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${BUILD_INFO_CMAKE_CACHE_ARCHIVE_PATH}\")
  3205. ")
  3206. #
  3207. # vendor msys stuff on Windows
  3208. #
  3209. if(OS_WINDOWS)
  3210. install(FILES /usr/bin/msys-protobuf-32.dll
  3211. /usr/bin/msys-uv-1.dll
  3212. DESTINATION "${BINDIR}")
  3213. # Make bash & netdata happy
  3214. install(DIRECTORY DESTINATION tmp)
  3215. # Make curl work with ssl
  3216. install(DIRECTORY /usr/ssl DESTINATION usr)
  3217. endif()
  3218. #
  3219. # Include packaging logic
  3220. #
  3221. include(Packaging)