CMakeLists.txt 130 KB

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