CMakeLists.txt 122 KB

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