CMakeLists.txt 121 KB

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