CMakeLists.txt 137 KB

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