CMakeLists.txt 101 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. cmake_minimum_required(VERSION 3.13.0)
  3. #
  4. # version atrocities
  5. #
  6. find_package(Git)
  7. if(GIT_EXECUTABLE)
  8. execute_process(COMMAND ${GIT_EXECUTABLE} describe
  9. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  10. RESULT_VARIABLE GIT_DESCRIBE_RESULT
  11. OUTPUT_VARIABLE GIT_DESCRIBE_OUTPUT)
  12. if(GIT_DESCRIBE_RESULT)
  13. file(STRINGS packaging/version GIT_DESCRIBE_OUTPUT)
  14. message(WARNING "using version from packaging/version: '${GIT_DESCRIBE_OUTPUT}'")
  15. endif()
  16. else()
  17. file(STRINGS packaging/version GIT_DESCRIBE_OUTPUT)
  18. message(WARNING "using version from packaging/version: '${GIT_DESCRIBE_OUTPUT}'")
  19. endif()
  20. string(STRIP ${GIT_DESCRIBE_OUTPUT} GIT_DESCRIBE_OUTPUT)
  21. string(REGEX MATCH "v?([0-9]+)\\.([0-9]+)\\.([0-9]+)-?([0-9]+)?-?([0-9a-zA-Z]+)?" MATCHES "${GIT_DESCRIBE_OUTPUT}")
  22. if(CMAKE_MATCH_COUNT EQUAL 3)
  23. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  24. set(FIELD_MINOR ${CMAKE_MATCH_2})
  25. set(FIELD_PATCH ${CMAKE_MATCH_3})
  26. set(FIELD_TWEAK 0)
  27. set(FIELD_DESCR "N/A")
  28. elseif(CMAKE_MATCH_COUNT EQUAL 4)
  29. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  30. set(FIELD_MINOR ${CMAKE_MATCH_2})
  31. set(FIELD_PATCH ${CMAKE_MATCH_3})
  32. set(FIELD_TWEAK ${CMAKE_MATCH_4})
  33. set(FIELD_DESCR "N/A")
  34. elseif(CMAKE_MATCH_COUNT EQUAL 5)
  35. set(FIELD_MAJOR ${CMAKE_MATCH_1})
  36. set(FIELD_MINOR ${CMAKE_MATCH_2})
  37. set(FIELD_PATCH ${CMAKE_MATCH_3})
  38. set(FIELD_TWEAK ${CMAKE_MATCH_4})
  39. set(FIELD_DESCR ${CMAKE_MATCH_5})
  40. else()
  41. message(FATAL_ERROR "Wrong version regex match count ${CMAKE_MATCH_COUNT} (should be in 3, 4 or 5)")
  42. endif()
  43. #
  44. # project
  45. #
  46. project(netdata
  47. VERSION ${FIELD_MAJOR}.${FIELD_MINOR}.${FIELD_PATCH}.${FIELD_TWEAK}
  48. DESCRIPTION "Netdata real-time monitoring"
  49. HOMEPAGE_URL "https://www.netdata.cloud"
  50. LANGUAGES C CXX)
  51. find_package(PkgConfig REQUIRED)
  52. set(CMAKE_C_STANDARD 11)
  53. set(CMAKE_CXX_STANDARD 14)
  54. option(USE_CXX_11 "use C++11 instead of C++14" False)
  55. if(USE_CXX_11)
  56. set(CMAKE_CXX_STANDARD 11)
  57. endif()
  58. set(CMAKE_C_STANDARD_REQUIRED On)
  59. set(CMAKE_CXX_STANDARD_REQUIRED On)
  60. set(SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P})
  61. if(NOT CMAKE_BUILD_TYPE)
  62. set(CMAKE_BUILD_TYPE "Release")
  63. endif()
  64. option(ENABLE_ADDRESS_SANITIZER "enable address sanitizer" False)
  65. if(ENABLE_ADDRESS_SANITIZER)
  66. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
  67. endif()
  68. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fexceptions")
  69. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_C_FLAGS}")
  70. set(CMAKE_EXPORT_COMPILE_COMMANDS On)
  71. set(CONFIG_H_DIR ${CMAKE_BINARY_DIR})
  72. set(CONFIG_H ${CONFIG_H_DIR}/config.h)
  73. option(ENABLE_CLOUD "enable cloud" True)
  74. option(ENABLE_ACLK "enable aclk" True)
  75. option(ENABLE_ML "enable machine learning" True)
  76. option(ENABLE_H2O "enable h2o" True)
  77. option(ENABLE_DBENGINE "enable dbengine" True)
  78. option(ENABLE_PLUGIN_DEBUGFS "enable debugfs.plugin" True)
  79. option(ENABLE_PLUGIN_APPS "enable apps.plugin" True)
  80. option(ENABLE_PLUGIN_FREEIPMI "enable freeipmi.plugin" True)
  81. option(ENABLE_PLUGIN_NFACCT "enable nfacct.plugin" True)
  82. option(ENABLE_PLUGIN_XENSTAT "enable xenstat.plugin" True)
  83. option(ENABLE_PLUGIN_PERF "enable perf.plugin" True)
  84. option(ENABLE_PLUGIN_SLABINFO "enable slabinfo.plugin" True)
  85. option(ENABLE_PLUGIN_CUPS "enable cups.plugin" True)
  86. option(ENABLE_PLUGIN_CGROUP_NETWORK "enable cgroup-network plugin" True)
  87. option(ENABLE_PLUGIN_EBPF "enable ebpf.plugin" True)
  88. option(ENABLE_PLUGIN_LOCAL_LISTENERS "enable local-listeners" True)
  89. option(ENABLE_PLUGIN_NETWORK_VIEWER "enable network-viewer" True)
  90. option(ENABLE_PLUGIN_SYSTEMD_JOURNAL "enable systemd-journal.plugin" True)
  91. option(ENABLE_PLUGIN_LOGS_MANAGEMENT "enable logs-management.plugin" True)
  92. option(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE "enable prometheus remote write exporter" True)
  93. option(ENABLE_EXPORTER_MONGODB "enable mongodb exporter" True)
  94. option(ENABLE_BUNDLED_JSONC "enable bundled json-c" False)
  95. option(ENABLE_BUNDLED_YAML "enable bundled yaml" False)
  96. option(ENABLE_BUNDLED_PROTOBUF "enable bundled protobuf" False)
  97. option(ENABLE_LOGS_MANAGEMENT_TESTS "enable logs management tests" True)
  98. option(ENABLE_SENTRY "enable sentry" False)
  99. option(ENABLE_WEBRTC "enable webrtc" False)
  100. if(ENABLE_SENTRY)
  101. include(FetchContent)
  102. # ignore debhelper
  103. set(FETCHCONTENT_FULLY_DISCONNECTED Off)
  104. set(SENTRY_VERSION 0.6.6)
  105. set(SENTRY_BACKEND "breakpad")
  106. set(SENTRY_BUILD_SHARED_LIBS OFF)
  107. FetchContent_Declare(
  108. sentry
  109. URL https://github.com/getsentry/sentry-native/releases/download/${SENTRY_VERSION}/sentry-native.zip
  110. URL_HASH SHA256=7a98467c0b2571380a3afc5e681cb13aa406a709529be12d74610b0015ccde0c
  111. )
  112. FetchContent_MakeAvailable(sentry)
  113. endif()
  114. if(ENABLE_WEBRTC)
  115. include(FetchContent)
  116. # ignore debhelper
  117. set(FETCHCONTENT_FULLY_DISCONNECTED Off)
  118. set(PREFER_SYSTEM_LIB True)
  119. set(NO_MEDIA True)
  120. set(NO_WEBSOCKET True)
  121. set(HAVE_LIBDATACHANNEL True)
  122. FetchContent_Declare(libdatachannel
  123. GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
  124. GIT_TAG v0.20.1
  125. )
  126. FetchContent_MakeAvailable(libdatachannel)
  127. endif()
  128. #
  129. # handling of extra compiler flags
  130. #
  131. include(CheckCCompilerFlag)
  132. include(CheckCXXCompilerFlag)
  133. # Disable hardening for debug builds by default.
  134. if(CMAKE_BUILD_TYPE STREQUAL "Debug")
  135. option(DISABLE_HARDENING "disable adding extra compiler flags for hardening" TRUE)
  136. else()
  137. option(DISABLE_HARDENING "disable adding extra compiler flags for hardening" FALSE)
  138. endif()
  139. # Construct a pre-processor safe name
  140. function(make_cpp_safe_name value target)
  141. string(REPLACE "-" "_" tmp "${value}")
  142. string(REPLACE "=" "_" tmp "${tmp}")
  143. set(${target} "${tmp}" PARENT_SCOPE)
  144. endfunction()
  145. # Conditionally add an extra compiler flag to C and C++ flags.
  146. #
  147. # If the language flags already match the `match` argument, skip this flag.
  148. # Otherwise, check for support for `flag` and if support is found, add it to
  149. # the language-specific `target` flag group.
  150. function(add_simple_extra_compiler_flag match flag target)
  151. set(CMAKE_REQUIRED_FLAGS "-Werror")
  152. make_cpp_safe_name("${flag}" flag_name)
  153. if(NOT ${CMAKE_C_FLAGS} MATCHES ${match})
  154. check_c_compiler_flag("${flag}" HAVE_C_${flag_name})
  155. if(HAVE_C_${flag_name})
  156. set(${target}_C_FLAGS "${${target}_C_FLAGS} ${flag}" PARENT_SCOPE)
  157. endif()
  158. endif()
  159. if(NOT ${CMAKE_CXX_FLAGS} MATCHES ${match})
  160. check_cxx_compiler_flag("${flag}" HAVE_CXX_${flag_name})
  161. if(HAVE_CXX_${flag_name})
  162. set(${target}_CXX_FLAGS "${${target}_CXX_FLAGS} ${flag}" PARENT_SCOPE)
  163. endif()
  164. endif()
  165. endfunction()
  166. # Same as add_simple_extra_compiler_flag, but check for a second flag if the
  167. # first one is unsupported.
  168. function(add_double_extra_compiler_flag match flag1 flag2 target)
  169. set(CMAKE_REQUIRED_FLAGS "-Werror")
  170. make_cpp_safe_name("${flag1}" flag1_name)
  171. make_cpp_safe_name("${flag2}" flag2_name)
  172. if(NOT ${CMAKE_C_FLAGS} MATCHES ${match})
  173. check_c_compiler_flag("${flag1}" HAVE_C_${flag1_name})
  174. if(HAVE_C_${flag1_name})
  175. set(${target}_C_FLAGS "${${target}_C_FLAGS} ${flag1}" PARENT_SCOPE)
  176. else()
  177. check_c_compiler_flag("${flag2}" HAVE_C_${flag2_name})
  178. if(HAVE_C_${flag2_name})
  179. set(${target}_C_FLAGS "${${target}_C_FLAGS} ${flag2}" PARENT_SCOPE)
  180. endif()
  181. endif()
  182. endif()
  183. if(NOT ${CMAKE_CXX_FLAGS} MATCHES ${match})
  184. check_cxx_compiler_flag("${flag1}" HAVE_CXX_${flag1_name})
  185. if(HAVE_CXX_${flag1_name})
  186. set(${target}_CXX_FLAGS "${${target}_CXX_FLAGS} ${flag1}" PARENT_SCOPE)
  187. else()
  188. check_cxx_compiler_flag("${flag2}" HAVE_CXX_${flag2_name})
  189. if(HAVE_CXX_${flag2_name})
  190. set(${target}_CXX_FLAGS "${${target}_CXX_FLAGS} ${flag2}" PARENT_SCOPE)
  191. endif()
  192. endif()
  193. endif()
  194. endfunction()
  195. set(EXTRA_HARDENING_C_FLAGS "")
  196. set(EXTRA_HARDENING_CXX_FLAGS "")
  197. set(EXTRA_OPT_C_FLAGS "")
  198. set(EXTRA_OPT_CXX_FLAGS "")
  199. if(NOT ${DISABLE_HARDENING})
  200. add_double_extra_compiler_flag("stack-protector" "-fstack-protector-strong" "-fstack-protector" EXTRA_HARDENING)
  201. add_double_extra_compiler_flag("_FORTIFY_SOURCE" "-D_FORTIFY_SOURCE=3" "-D_FORTIFY_SOURCE=2" EXTRA_HARDENING)
  202. add_simple_extra_compiler_flag("stack-clash-protection" "-fstack-clash-protection" EXTRA_HARDENING)
  203. add_simple_extra_compiler_flag("-fcf-protection" "-fcf-protection=full" EXTRA_HARDENING)
  204. add_simple_extra_compiler_flag("branch-protection" "-mbranch-protection=standard" EXTRA_HARDENING)
  205. endif()
  206. foreach(FLAG function-sections data-sections)
  207. add_simple_extra_compiler_flag("${FLAG}" "-f${FLAG}" EXTRA_OPT)
  208. endforeach()
  209. foreach(RELTYP RELEASE DEBUG RELWITHDEBINFO MINSIZEREL)
  210. foreach(L C CXX)
  211. set(CMAKE_${L}_FLAGS_${RELTYP} "${CMAKE_${L}_FLAGS_${RELTYP}} ${EXTRA_HARDENING_C_FLAGS} ${EXTRA_OPT_C_FLAGS}")
  212. endforeach()
  213. endforeach()
  214. #
  215. # detect OS
  216. #
  217. set(LINUX False)
  218. set(FREEBSD False)
  219. set(MACOS False)
  220. if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  221. set(MACOS True)
  222. set(COMPILED_FOR_MACOS True)
  223. find_library(IOKIT IOKit)
  224. find_library(FOUNDATION Foundation)
  225. elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  226. set(FREEBSD True)
  227. set(COMPILED_FOR_FREEBSD True)
  228. else()
  229. set(LINUX True)
  230. set(COMPILED_FOR_LINUX True)
  231. add_definitions(-D_GNU_SOURCE)
  232. endif()
  233. #
  234. # Libm
  235. #
  236. # checks link with cmake required libs
  237. cmake_policy(SET CMP0075 NEW)
  238. include(CheckFunctionExists)
  239. check_function_exists(log10 HAVE_LOG10)
  240. if(NOT HAVE_LOG10)
  241. unset(HAVE_LOG10 CACHE)
  242. list(APPEND CMAKE_REQUIRED_LIBRARIES m)
  243. check_function_exists(log10 HAVE_LOG10)
  244. if(HAVE_LOG10)
  245. set(LINK_LIBM True CACHE BOOL "" FORCE)
  246. else()
  247. message(FATAL_ERROR "Can not use log10 with/without libm.")
  248. endif()
  249. endif()
  250. #
  251. # check include files
  252. #
  253. include(CheckIncludeFile)
  254. check_include_file("netinet/in.h" HAVE_NETINET_IN_H)
  255. check_include_file("resolv.h" HAVE_RESOLV_H)
  256. check_include_file("netdb.h" HAVE_NETDB_H)
  257. check_include_file("sys/prctl.h" HAVE_SYS_PRCTL_H)
  258. check_include_file("sys/stat.h" HAVE_SYS_STAT_H)
  259. check_include_file("sys/vfs.h" HAVE_SYS_VFS_H)
  260. check_include_file("sys/statfs.h" HAVE_SYS_STATFS_H)
  261. check_include_file("linux/magic.h" HAVE_LINUX_MAGIC_H)
  262. check_include_file("sys/mount.h" HAVE_SYS_MOUNT_H)
  263. check_include_file("sys/statvfs.h" HAVE_SYS_STATVFS_H)
  264. check_include_file("inttypes.h" HAVE_INTTYPES_H)
  265. check_include_file("stdint.h" HAVE_STDINT_H)
  266. check_include_file("sys/capability.h" HAVE_SYS_CAPABILITY_H)
  267. #
  268. # check libraries we need
  269. #
  270. include(CheckLibraryExists)
  271. check_library_exists(snappy snappy_compress "" HAVE_SNAPPY_LIB)
  272. #check_include_file("snappy.h" HAVE_SNAPPY_H)
  273. #
  274. # check symbols
  275. #
  276. include(CheckSymbolExists)
  277. check_symbol_exists(major "sys/sysmacros.h" MAJOR_IN_SYSMACROS)
  278. check_symbol_exists(major "sys/mkdev.h" MAJOR_IN_MKDEV)
  279. check_symbol_exists(clock_gettime "time.h" HAVE_CLOCK_GETTIME)
  280. check_symbol_exists(strerror_r "string.h" HAVE_STRERROR_R)
  281. check_symbol_exists(finite "math.h" HAVE_FINITE)
  282. check_symbol_exists(isfinite "math.h" HAVE_ISFINITE)
  283. check_symbol_exists(dlsym "dlfcn.h" HAVE_DLSYM)
  284. check_function_exists(nice HAVE_NICE)
  285. check_function_exists(recvmmsg HAVE_RECVMMSG)
  286. check_function_exists(getpriority HAVE_GETPRIORITY)
  287. check_function_exists(sched_getscheduler HAVE_SCHED_GETSCHEDULER)
  288. check_function_exists(sched_setscheduler HAVE_SCHED_SETSCHEDULER)
  289. check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
  290. check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
  291. check_function_exists(close_range HAVE_CLOSE_RANGE)
  292. check_function_exists(backtrace HAVE_BACKTRACE)
  293. #
  294. # check source compilation
  295. #
  296. include(CheckCSourceCompiles)
  297. include(CheckCXXSourceCompiles)
  298. set(CMAKE_REQUIRED_LIBRARIES pthread)
  299. check_c_source_compiles("
  300. #define _GNU_SOURCE
  301. #include <pthread.h>
  302. int main() {
  303. char name[16];
  304. pthread_t thread = pthread_self();
  305. return pthread_getname_np(thread, name, sizeof(name));
  306. }
  307. " HAVE_PTHREAD_GETNAME_NP)
  308. check_c_source_compiles("
  309. #include <stdio.h>
  310. #define mytype(X) _Generic((X), int: 'i', float: 'f', default: 'u')
  311. int main() {
  312. char type = mytype(0);
  313. return 0;
  314. }
  315. " HAVE_C__GENERIC)
  316. check_c_source_compiles("
  317. #include <malloc.h>
  318. int main() {
  319. mallopt(M_ARENA_MAX, 1);
  320. mallopt(M_PERTURB, 0x5A);
  321. return 0;
  322. }
  323. " HAVE_C_MALLOPT)
  324. check_c_source_compiles("
  325. #define _GNU_SOURCE
  326. #include <stdio.h>
  327. #include <sys/socket.h>
  328. int main() {
  329. accept4(0, NULL, NULL, 0);
  330. return 0;
  331. }
  332. " HAVE_ACCEPT4)
  333. check_c_source_compiles("
  334. #define _GNU_SOURCE
  335. #include <string.h>
  336. int main() {
  337. char x = *strerror_r(0, &x, sizeof(x)); return 0;
  338. }
  339. " STRERROR_R_CHAR_P)
  340. check_c_source_compiles("
  341. #ifndef _GNU_SOURCE
  342. #define _GNU_SOURCE
  343. #endif
  344. #include <sched.h>
  345. int main() {
  346. setns(0, 0); return 0;
  347. }
  348. " HAVE_SETNS)
  349. check_cxx_source_compiles("
  350. int main() {
  351. __atomic_load_8(nullptr, 0);
  352. return 0;
  353. }
  354. " HAVE_BUILTIN_ATOMICS)
  355. check_c_source_compiles("
  356. void my_printf(char const *s, ...) __attribute__((format(printf, 1, 2)));
  357. int main() { return 0; }
  358. " HAVE_FUNC_ATTRIBUTE_FORMAT)
  359. check_c_source_compiles("
  360. #include <stdio.h>
  361. #include <stdlib.h>
  362. #include <unistd.h>
  363. void* my_alloc(size_t size) __attribute__((malloc));
  364. int main() {
  365. void *x = my_alloc(1);
  366. free(x);
  367. return 0;
  368. }
  369. void* my_alloc(size_t size) {
  370. void *ret = malloc(size);
  371. if(!ret) exit(1);
  372. return ret;
  373. }
  374. " HAVE_FUNC_ATTRIBUTE_MALLOC)
  375. check_c_source_compiles("
  376. void my_function() __attribute__((noinline));
  377. int main() { my_function(); return 0; }
  378. void my_function() { ; }
  379. " HAVE_FUNC_ATTRIBUTE_NOINLINE)
  380. check_c_source_compiles("
  381. void my_exit_function() __attribute__((noreturn));
  382. int main() {
  383. my_exit_function(); // Call the noreturn function
  384. return 0;
  385. }
  386. void my_exit_function() {
  387. exit(1);
  388. }
  389. " HAVE_FUNC_ATTRIBUTE_NORETURN)
  390. check_c_source_compiles("
  391. #include <stdio.h>
  392. #include <stdlib.h>
  393. #include <unistd.h>
  394. void* my_alloc(size_t size) __attribute__((returns_nonnull));
  395. int main() {
  396. void* ptr = my_alloc(10);
  397. free(ptr);
  398. return 0;
  399. }
  400. void* my_alloc(size_t size) {
  401. void *ret = malloc(size);
  402. if(!ret) exit(1);
  403. return ret;
  404. }
  405. " HAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL)
  406. check_c_source_compiles("
  407. int my_function() __attribute__((warn_unused_result));
  408. int main() {
  409. return my_function();
  410. }
  411. int my_function() {
  412. return 1;
  413. }
  414. " HAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT)
  415. if(FREEBSD OR MACOS)
  416. set(HAVE_BUILTIN_ATOMICS True)
  417. endif()
  418. # openssl/crypto
  419. set(ENABLE_OPENSSL True)
  420. if(NOT MACOS)
  421. pkg_check_modules(CRYPTO libcrypto)
  422. pkg_check_modules(OPENSSL REQUIRED openssl)
  423. else()
  424. # I think this is moot because we can only use openssl 3.x
  425. execute_process(COMMAND
  426. brew --prefix --installed openssl
  427. RESULT_VARIABLE BREW_OPENSSL
  428. OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
  429. OUTPUT_STRIP_TRAILING_WHITESPACE)
  430. if((BREW_OPENSSL NOT EQUAL 0) OR (NOT EXISTS "${BREW_OPENSSL_PREFIX}"))
  431. execute_process(COMMAND
  432. brew --prefix --installed openssl@3
  433. RESULT_VARIABLE BREW_OPENSSL
  434. OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
  435. OUTPUT_STRIP_TRAILING_WHITESPACE)
  436. if((BREW_OPENSSL NOT EQUAL 0) OR (NOT EXISTS "${BREW_OPENSSL_PREFIX}"))
  437. execute_process(COMMAND
  438. brew --prefix --installed openssl@1.1
  439. RESULT_VARIABLE BREW_OPENSSL
  440. OUTPUT_VARIABLE BREW_OPENSSL_PREFIX
  441. OUTPUT_STRIP_TRAILING_WHITESPACE)
  442. if((BREW_OPENSSL NOT EQUAL 0) OR (NOT EXISTS "${BREW_OPENSSL_PREFIX}"))
  443. message(FATAL_ERROR "Could not find openssl prefix with brew")
  444. endif()
  445. endif()
  446. endif()
  447. set(OPENSSL_INCLUDE_DIRS "${BREW_OPENSSL_PREFIX}/include")
  448. set(OPENSSL_CFLAGS_OTHER "")
  449. set(OPENSSL_LDFLAGS "-L${BREW_OPENSSL_PREFIX}/lib;-lssl;-lcrypto")
  450. endif()
  451. #
  452. # figure out if we need protoc/protobuf
  453. #
  454. if(ENABLE_ACLK OR ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  455. if(ENABLE_BUNDLED_PROTOBUF)
  456. set(PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_SOURCE_DIR}/externaldeps/protobuf/src/protoc")
  457. set(PROTOBUF_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/externaldeps/protobuf/src")
  458. set(PROTOBUF_LIBRARIES "${CMAKE_SOURCE_DIR}/externaldeps/protobuf/src/.libs/libprotobuf.a")
  459. else()
  460. if (NOT BUILD_SHARED_LIBS)
  461. set(Protobuf_USE_STATIC_LIBS On)
  462. endif()
  463. find_package(Protobuf)
  464. endif()
  465. set(ENABLE_PROTOBUF True)
  466. set(HAVE_PROTOBUF True)
  467. if (ENABLE_BUNDLED_PROTOBUF)
  468. set(BUNDLED_PROTOBUF True)
  469. endif()
  470. endif()
  471. #
  472. # source files
  473. #
  474. set(LIBJUDY_PREV_FILES
  475. src/libnetdata/libjudy/src/JudyL/JudyLPrev.c
  476. src/libnetdata/libjudy/src/JudyL/JudyLPrevEmpty.c
  477. )
  478. set(LIBJUDY_NEXT_FILES
  479. src/libnetdata/libjudy/src/JudyL/JudyLNext.c
  480. src/libnetdata/libjudy/src/JudyL/JudyLNextEmpty.c
  481. )
  482. set(LIBJUDY_SOURCES
  483. src/libnetdata/libjudy/src/Judy.h
  484. src/libnetdata/libjudy/src/JudyCommon/JudyMalloc.c
  485. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate.h
  486. src/libnetdata/libjudy/src/JudyCommon/JudyPrivate1L.h
  487. src/libnetdata/libjudy/src/JudyCommon/JudyPrivateBranch.h
  488. src/libnetdata/libjudy/src/JudyL/JudyL.h
  489. src/libnetdata/libjudy/src/JudyL/JudyLByCount.c
  490. src/libnetdata/libjudy/src/JudyL/JudyLCascade.c
  491. src/libnetdata/libjudy/src/JudyL/JudyLCount.c
  492. src/libnetdata/libjudy/src/JudyL/JudyLCreateBranch.c
  493. src/libnetdata/libjudy/src/JudyL/JudyLDecascade.c
  494. src/libnetdata/libjudy/src/JudyL/JudyLDel.c
  495. src/libnetdata/libjudy/src/JudyL/JudyLFirst.c
  496. src/libnetdata/libjudy/src/JudyL/JudyLFreeArray.c
  497. src/libnetdata/libjudy/src/JudyL/j__udyLGet.c
  498. src/libnetdata/libjudy/src/JudyL/JudyLGet.c
  499. src/libnetdata/libjudy/src/JudyL/JudyLInsArray.c
  500. src/libnetdata/libjudy/src/JudyL/JudyLIns.c
  501. src/libnetdata/libjudy/src/JudyL/JudyLInsertBranch.c
  502. src/libnetdata/libjudy/src/JudyL/JudyLMallocIF.c
  503. src/libnetdata/libjudy/src/JudyL/JudyLMemActive.c
  504. src/libnetdata/libjudy/src/JudyL/JudyLMemUsed.c
  505. src/libnetdata/libjudy/src/JudyL/JudyLTables.c
  506. src/libnetdata/libjudy/src/JudyHS/JudyHS.c
  507. ${LIBJUDY_PREV_FILES}
  508. ${LIBJUDY_NEXT_FILES}
  509. )
  510. set(LIBNETDATA_FILES
  511. ${CONFIG_H}
  512. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  513. src/libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  514. src/libnetdata/config/appconfig.c
  515. src/libnetdata/config/appconfig.h
  516. src/libnetdata/aral/aral.c
  517. src/libnetdata/aral/aral.h
  518. src/libnetdata/avl/avl.c
  519. src/libnetdata/avl/avl.h
  520. src/libnetdata/buffer/buffer.c
  521. src/libnetdata/buffer/buffer.h
  522. src/libnetdata/circular_buffer/circular_buffer.c
  523. src/libnetdata/circular_buffer/circular_buffer.h
  524. src/libnetdata/clocks/clocks.c
  525. src/libnetdata/clocks/clocks.h
  526. src/libnetdata/completion/completion.c
  527. src/libnetdata/completion/completion.h
  528. src/libnetdata/datetime/iso8601.c
  529. src/libnetdata/datetime/iso8601.h
  530. src/libnetdata/datetime/rfc7231.c
  531. src/libnetdata/datetime/rfc7231.h
  532. src/libnetdata/datetime/rfc3339.c
  533. src/libnetdata/datetime/rfc3339.h
  534. src/libnetdata/dictionary/dictionary.c
  535. src/libnetdata/dictionary/dictionary.h
  536. src/libnetdata/eval/eval.c
  537. src/libnetdata/eval/eval.h
  538. src/libnetdata/facets/facets.c
  539. src/libnetdata/facets/facets.h
  540. src/libnetdata/functions_evloop/functions_evloop.c
  541. src/libnetdata/functions_evloop/functions_evloop.h
  542. src/libnetdata/gorilla/gorilla.cc
  543. src/libnetdata/gorilla/gorilla.h
  544. src/libnetdata/july/july.c
  545. src/libnetdata/july/july.h
  546. src/libnetdata/inlined.h
  547. src/libnetdata/json/json.c
  548. src/libnetdata/json/json.h
  549. src/libnetdata/json/jsmn.c
  550. src/libnetdata/json/jsmn.h
  551. src/libnetdata/libnetdata.c
  552. src/libnetdata/libnetdata.h
  553. src/libnetdata/line_splitter/line_splitter.c
  554. src/libnetdata/line_splitter/line_splitter.h
  555. src/libnetdata/libnetdata.h
  556. src/libnetdata/locks/locks.c
  557. src/libnetdata/locks/locks.h
  558. src/libnetdata/log/journal.c
  559. src/libnetdata/log/journal.h
  560. src/libnetdata/log/log.c
  561. src/libnetdata/log/log.h
  562. src/libnetdata/os.c
  563. src/libnetdata/os.h
  564. src/libnetdata/simple_hashtable.h
  565. src/libnetdata/endian.h
  566. src/libnetdata/onewayalloc/onewayalloc.c
  567. src/libnetdata/onewayalloc/onewayalloc.h
  568. src/libnetdata/popen/popen.c
  569. src/libnetdata/popen/popen.h
  570. src/libnetdata/procfile/procfile.c
  571. src/libnetdata/procfile/procfile.h
  572. src/libnetdata/query_progress/progress.c
  573. src/libnetdata/query_progress/progress.h
  574. src/libnetdata/required_dummies.h
  575. src/libnetdata/socket/security.c
  576. src/libnetdata/socket/security.h
  577. src/libnetdata/simple_pattern/simple_pattern.c
  578. src/libnetdata/simple_pattern/simple_pattern.h
  579. src/libnetdata/socket/socket.c
  580. src/libnetdata/socket/socket.h
  581. src/libnetdata/statistical/statistical.c
  582. src/libnetdata/statistical/statistical.h
  583. src/libnetdata/storage_number/storage_number.c
  584. src/libnetdata/storage_number/storage_number.h
  585. src/libnetdata/string/string.c
  586. src/libnetdata/string/string.h
  587. src/libnetdata/threads/threads.c
  588. src/libnetdata/threads/threads.h
  589. src/libnetdata/url/url.c
  590. src/libnetdata/url/url.h
  591. src/libnetdata/uuid/uuid.c
  592. src/libnetdata/uuid/uuid.h
  593. src/libnetdata/string/utf8.h
  594. src/libnetdata/worker_utilization/worker_utilization.c
  595. src/libnetdata/worker_utilization/worker_utilization.h
  596. src/libnetdata/http/http_access.c
  597. src/libnetdata/http/http_access.h
  598. src/libnetdata/http/http_defs.c
  599. src/libnetdata/http/http_defs.h
  600. src/libnetdata/http/content_type.c
  601. src/libnetdata/http/content_type.h
  602. src/libnetdata/config/dyncfg.c
  603. src/libnetdata/config/dyncfg.h
  604. src/libnetdata/json/json-c-parser-inline.h
  605. src/libnetdata/template-enum.h
  606. src/libnetdata/dictionary/dictionary-internals.h
  607. src/libnetdata/dictionary/dictionary-unittest.c
  608. src/libnetdata/dictionary/thread-cache.c
  609. src/libnetdata/dictionary/thread-cache.h
  610. src/libnetdata/dictionary/dictionary-traversal.c
  611. src/libnetdata/dictionary/dictionary-statistics.h
  612. src/libnetdata/dictionary/dictionary-locks.h
  613. src/libnetdata/dictionary/dictionary-refcount.h
  614. src/libnetdata/dictionary/dictionary-hashtable.h
  615. src/libnetdata/dictionary/dictionary-item.h
  616. src/libnetdata/dictionary/dictionary-callbacks.h
  617. )
  618. if(ENABLE_PLUGIN_EBPF)
  619. list(APPEND LIBNETDATA_FILES
  620. src/libnetdata/ebpf/ebpf.c
  621. src/libnetdata/ebpf/ebpf.h
  622. )
  623. endif()
  624. set(LIBH2O_FILES
  625. web/server/h2o/libh2o/deps/cloexec/cloexec.c
  626. web/server/h2o/libh2o/deps/libgkc/gkc.c
  627. web/server/h2o/libh2o/deps/libyrmcds/close.c
  628. web/server/h2o/libh2o/deps/libyrmcds/connect.c
  629. web/server/h2o/libh2o/deps/libyrmcds/recv.c
  630. web/server/h2o/libh2o/deps/libyrmcds/send.c
  631. web/server/h2o/libh2o/deps/libyrmcds/send_text.c
  632. web/server/h2o/libh2o/deps/libyrmcds/socket.c
  633. web/server/h2o/libh2o/deps/libyrmcds/strerror.c
  634. web/server/h2o/libh2o/deps/libyrmcds/text_mode.c
  635. web/server/h2o/libh2o/deps/picohttpparser/picohttpparser.c
  636. web/server/h2o/libh2o/lib/common/cache.c
  637. web/server/h2o/libh2o/lib/common/file.c
  638. web/server/h2o/libh2o/lib/common/filecache.c
  639. web/server/h2o/libh2o/lib/common/hostinfo.c
  640. web/server/h2o/libh2o/lib/common/http1client.c
  641. web/server/h2o/libh2o/lib/common/memcached.c
  642. web/server/h2o/libh2o/lib/common/memory.c
  643. web/server/h2o/libh2o/lib/common/multithread.c
  644. web/server/h2o/libh2o/lib/common/serverutil.c
  645. web/server/h2o/libh2o/lib/common/socket.c
  646. web/server/h2o/libh2o/lib/common/socketpool.c
  647. web/server/h2o/libh2o/lib/common/string.c
  648. web/server/h2o/libh2o/lib/common/time.c
  649. web/server/h2o/libh2o/lib/common/timeout.c
  650. web/server/h2o/libh2o/lib/common/url.c
  651. web/server/h2o/libh2o/lib/core/config.c
  652. web/server/h2o/libh2o/lib/core/configurator.c
  653. web/server/h2o/libh2o/lib/core/context.c
  654. web/server/h2o/libh2o/lib/core/headers.c
  655. web/server/h2o/libh2o/lib/core/logconf.c
  656. web/server/h2o/libh2o/lib/core/proxy.c
  657. web/server/h2o/libh2o/lib/core/request.c
  658. web/server/h2o/libh2o/lib/core/token.c
  659. web/server/h2o/libh2o/lib/core/util.c
  660. web/server/h2o/libh2o/lib/handler/access_log.c
  661. web/server/h2o/libh2o/lib/handler/chunked.c
  662. web/server/h2o/libh2o/lib/handler/compress.c
  663. web/server/h2o/libh2o/lib/handler/compress/gzip.c
  664. web/server/h2o/libh2o/lib/handler/errordoc.c
  665. web/server/h2o/libh2o/lib/handler/expires.c
  666. web/server/h2o/libh2o/lib/handler/fastcgi.c
  667. web/server/h2o/libh2o/lib/handler/file.c
  668. web/server/h2o/libh2o/lib/handler/headers.c
  669. web/server/h2o/libh2o/lib/handler/mimemap.c
  670. web/server/h2o/libh2o/lib/handler/proxy.c
  671. web/server/h2o/libh2o/lib/handler/redirect.c
  672. web/server/h2o/libh2o/lib/handler/reproxy.c
  673. web/server/h2o/libh2o/lib/handler/throttle_resp.c
  674. web/server/h2o/libh2o/lib/handler/status.c
  675. web/server/h2o/libh2o/lib/handler/headers_util.c
  676. web/server/h2o/libh2o/lib/handler/status/events.c
  677. web/server/h2o/libh2o/lib/handler/status/requests.c
  678. web/server/h2o/libh2o/lib/handler/http2_debug_state.c
  679. web/server/h2o/libh2o/lib/handler/status/durations.c
  680. web/server/h2o/libh2o/lib/handler/configurator/access_log.c
  681. web/server/h2o/libh2o/lib/handler/configurator/compress.c
  682. web/server/h2o/libh2o/lib/handler/configurator/errordoc.c
  683. web/server/h2o/libh2o/lib/handler/configurator/expires.c
  684. web/server/h2o/libh2o/lib/handler/configurator/fastcgi.c
  685. web/server/h2o/libh2o/lib/handler/configurator/file.c
  686. web/server/h2o/libh2o/lib/handler/configurator/headers.c
  687. web/server/h2o/libh2o/lib/handler/configurator/proxy.c
  688. web/server/h2o/libh2o/lib/handler/configurator/redirect.c
  689. web/server/h2o/libh2o/lib/handler/configurator/reproxy.c
  690. web/server/h2o/libh2o/lib/handler/configurator/throttle_resp.c
  691. web/server/h2o/libh2o/lib/handler/configurator/status.c
  692. web/server/h2o/libh2o/lib/handler/configurator/http2_debug_state.c
  693. web/server/h2o/libh2o/lib/handler/configurator/headers_util.c
  694. web/server/h2o/libh2o/lib/http1.c
  695. web/server/h2o/libh2o/lib/tunnel.c
  696. web/server/h2o/libh2o/lib/http2/cache_digests.c
  697. web/server/h2o/libh2o/lib/http2/casper.c
  698. web/server/h2o/libh2o/lib/http2/connection.c
  699. web/server/h2o/libh2o/lib/http2/frame.c
  700. web/server/h2o/libh2o/lib/http2/hpack.c
  701. web/server/h2o/libh2o/lib/http2/scheduler.c
  702. web/server/h2o/libh2o/lib/http2/stream.c
  703. web/server/h2o/libh2o/lib/http2/http2_debug_state.c
  704. )
  705. set(DAEMON_FILES
  706. src/daemon/buildinfo.c
  707. src/daemon/buildinfo.h
  708. src/daemon/common.c
  709. src/daemon/common.h
  710. src/daemon/daemon.c
  711. src/daemon/daemon.h
  712. src/daemon/event_loop.c
  713. src/daemon/event_loop.h
  714. src/daemon/global_statistics.c
  715. src/daemon/global_statistics.h
  716. src/daemon/analytics.c
  717. src/daemon/analytics.h
  718. src/daemon/main.c
  719. src/daemon/main.h
  720. src/daemon/signals.c
  721. src/daemon/signals.h
  722. src/daemon/service.c
  723. src/daemon/static_threads.c
  724. src/daemon/static_threads.h
  725. src/daemon/commands.c
  726. src/daemon/commands.h
  727. src/daemon/pipename.c
  728. src/daemon/pipename.h
  729. src/daemon/unit_test.c
  730. src/daemon/unit_test.h
  731. src/daemon/config/dyncfg.c
  732. src/daemon/config/dyncfg.h
  733. src/daemon/config/dyncfg-files.c
  734. src/daemon/config/dyncfg-unittest.c
  735. src/daemon/config/dyncfg-inline.c
  736. src/daemon/config/dyncfg-echo.c
  737. src/daemon/config/dyncfg-internals.h
  738. src/daemon/config/dyncfg-intercept.c
  739. src/daemon/config/dyncfg-tree.c
  740. )
  741. set(H2O_FILES
  742. web/server/h2o/http_server.c
  743. web/server/h2o/http_server.h
  744. web/server/h2o/h2o_utils.c
  745. web/server/h2o/h2o_utils.h
  746. web/server/h2o/streaming.c
  747. web/server/h2o/streaming.h
  748. web/server/h2o/connlist.c
  749. web/server/h2o/connlist.h
  750. )
  751. if(ENABLE_H2O)
  752. list(APPEND DAEMON_FILES ${H2O_FILES})
  753. endif()
  754. set(API_PLUGIN_FILES
  755. web/api/web_api.c
  756. web/api/web_api.h
  757. web/api/web_api_v1.c
  758. web/api/web_api_v1.h
  759. web/api/web_api_v2.c
  760. web/api/web_api_v2.h
  761. web/api/http_auth.c
  762. web/api/http_auth.h
  763. web/api/http_header.c
  764. web/api/http_header.h
  765. web/api/badges/web_buffer_svg.c
  766. web/api/badges/web_buffer_svg.h
  767. web/api/exporters/allmetrics.c
  768. web/api/exporters/allmetrics.h
  769. web/api/exporters/shell/allmetrics_shell.c
  770. web/api/exporters/shell/allmetrics_shell.h
  771. web/api/queries/rrdr.c
  772. web/api/queries/rrdr.h
  773. web/api/queries/query.c
  774. web/api/queries/query.h
  775. web/api/queries/average/average.c
  776. web/api/queries/average/average.h
  777. web/api/queries/countif/countif.c
  778. web/api/queries/countif/countif.h
  779. web/api/queries/incremental_sum/incremental_sum.c
  780. web/api/queries/incremental_sum/incremental_sum.h
  781. web/api/queries/max/max.c
  782. web/api/queries/max/max.h
  783. web/api/queries/min/min.c
  784. web/api/queries/min/min.h
  785. web/api/queries/sum/sum.c
  786. web/api/queries/sum/sum.h
  787. web/api/queries/median/median.c
  788. web/api/queries/median/median.h
  789. web/api/queries/percentile/percentile.c
  790. web/api/queries/percentile/percentile.h
  791. web/api/queries/stddev/stddev.c
  792. web/api/queries/stddev/stddev.h
  793. web/api/queries/ses/ses.c
  794. web/api/queries/ses/ses.h
  795. web/api/queries/des/des.c
  796. web/api/queries/des/des.h
  797. web/api/queries/trimmed_mean/trimmed_mean.c
  798. web/api/queries/trimmed_mean/trimmed_mean.h
  799. web/api/queries/weights.c
  800. web/api/queries/weights.h
  801. web/api/formatters/rrd2json.c
  802. web/api/formatters/rrd2json.h
  803. web/api/formatters/csv/csv.c
  804. web/api/formatters/csv/csv.h
  805. web/api/formatters/json/json.c
  806. web/api/formatters/json/json.h
  807. web/api/formatters/ssv/ssv.c
  808. web/api/formatters/ssv/ssv.h
  809. web/api/formatters/value/value.c
  810. web/api/formatters/value/value.h
  811. web/api/formatters/json_wrapper.c
  812. web/api/formatters/json_wrapper.h
  813. web/api/formatters/charts2json.c
  814. web/api/formatters/charts2json.h
  815. web/api/formatters/rrdset2json.c
  816. web/api/formatters/rrdset2json.h
  817. web/api/ilove/ilove.c
  818. web/api/ilove/ilove.h
  819. web/rtc/webrtc.c
  820. web/rtc/webrtc.h
  821. )
  822. set(EXPORTING_ENGINE_FILES
  823. src/exporting/exporting_engine.c
  824. src/exporting/exporting_engine.h
  825. src/exporting/graphite/graphite.c
  826. src/exporting/graphite/graphite.h
  827. src/exporting/json/json.c
  828. src/exporting/json/json.h
  829. src/exporting/opentsdb/opentsdb.c
  830. src/exporting/opentsdb/opentsdb.h
  831. src/exporting/prometheus/prometheus.c
  832. src/exporting/prometheus/prometheus.h
  833. src/exporting/read_config.c
  834. src/exporting/clean_connectors.c
  835. src/exporting/init_connectors.c
  836. src/exporting/process_data.c
  837. src/exporting/check_filters.c
  838. src/exporting/send_data.c
  839. src/exporting/send_internal_metrics.c
  840. )
  841. set(HEALTH_PLUGIN_FILES
  842. src/health/health.c
  843. src/health/health.h
  844. src/health/health_config.c
  845. src/health/health_json.c
  846. src/health/health_log.c
  847. src/health/health_prototypes.c
  848. src/health/health_prototypes.h
  849. src/health/health_silencers.c
  850. src/health/health_silencers.h
  851. src/health/health_internals.h
  852. src/health/health_notifications.c
  853. src/health/health_event_loop.c
  854. src/health/health_dyncfg.c
  855. src/health/health_variable.c
  856. src/health/rrdcalc.c
  857. src/health/rrdcalc.h
  858. src/health/rrdvar.c
  859. src/health/rrdvar.h
  860. )
  861. set(IDLEJITTER_PLUGIN_FILES src/collectors/idlejitter.plugin/plugin_idlejitter.c)
  862. if(ENABLE_ML)
  863. set(ML_FILES
  864. src/ml/ad_charts.h
  865. src/ml/ad_charts.cc
  866. src/ml/Config.cc
  867. src/ml/dlib/dlib/all/source.cpp
  868. src/ml/ml.h
  869. src/ml/ml.cc
  870. src/ml/ml-private.h
  871. )
  872. else()
  873. set(ML_FILES
  874. src/ml/ml.h
  875. src/ml/ml-dummy.c
  876. )
  877. endif()
  878. set(PLUGINSD_PLUGIN_FILES
  879. src/collectors/plugins.d/plugins_d.c
  880. src/collectors/plugins.d/plugins_d.h
  881. src/collectors/plugins.d/pluginsd_dyncfg.c
  882. src/collectors/plugins.d/pluginsd_dyncfg.h
  883. src/collectors/plugins.d/pluginsd_functions.c
  884. src/collectors/plugins.d/pluginsd_functions.h
  885. src/collectors/plugins.d/pluginsd_internals.c
  886. src/collectors/plugins.d/pluginsd_internals.h
  887. src/collectors/plugins.d/pluginsd_parser.c
  888. src/collectors/plugins.d/pluginsd_parser.h
  889. src/collectors/plugins.d/pluginsd_replication.c
  890. src/collectors/plugins.d/pluginsd_replication.h
  891. )
  892. set(RRD_PLUGIN_FILES
  893. src/database/contexts/api_v1.c
  894. src/database/contexts/api_v2.c
  895. src/database/contexts/context.c
  896. src/database/contexts/instance.c
  897. src/database/contexts/internal.h
  898. src/database/contexts/metric.c
  899. src/database/contexts/query_scope.c
  900. src/database/contexts/query_target.c
  901. src/database/contexts/rrdcontext.c
  902. src/database/contexts/rrdcontext.h
  903. src/database/contexts/worker.c
  904. src/database/rrdcollector.c
  905. src/database/rrdcollector.h
  906. src/database/rrddim.c
  907. src/database/rrdfunctions.c
  908. src/database/rrdfunctions.h
  909. src/database/rrdfunctions-inline.c
  910. src/database/rrdfunctions-inline.h
  911. src/database/rrdfunctions-progress.c
  912. src/database/rrdfunctions-progress.h
  913. src/database/rrdfunctions-streaming.c
  914. src/database/rrdfunctions-streaming.h
  915. src/database/rrdhost.c
  916. src/database/rrdlabels.c
  917. src/database/rrd.c
  918. src/database/rrd.h
  919. src/database/rrdset.c
  920. src/database/storage_engine.c
  921. src/database/storage_engine.h
  922. src/database/ram/rrddim_mem.c
  923. src/database/ram/rrddim_mem.h
  924. src/database/sqlite/sqlite_metadata.c
  925. src/database/sqlite/sqlite_metadata.h
  926. src/database/sqlite/sqlite_functions.c
  927. src/database/sqlite/sqlite_functions.h
  928. src/database/sqlite/sqlite_context.c
  929. src/database/sqlite/sqlite_context.h
  930. src/database/sqlite/sqlite_db_migration.c
  931. src/database/sqlite/sqlite_db_migration.h
  932. src/database/sqlite/sqlite_aclk.c
  933. src/database/sqlite/sqlite_aclk.h
  934. src/database/sqlite/sqlite_health.c
  935. src/database/sqlite/sqlite_health.h
  936. src/database/sqlite/sqlite_aclk_node.c
  937. src/database/sqlite/sqlite_aclk_node.h
  938. src/database/sqlite/sqlite_aclk_alert.c
  939. src/database/sqlite/sqlite_aclk_alert.h
  940. src/database/sqlite/sqlite3.c
  941. src/database/sqlite/sqlite3.h
  942. src/database/sqlite/sqlite3recover.c
  943. src/database/sqlite/sqlite3recover.h
  944. src/database/sqlite/dbdata.c
  945. src/database/KolmogorovSmirnovDist.c
  946. src/database/KolmogorovSmirnovDist.h
  947. src/database/rrdfunctions-inflight.c
  948. src/database/rrdfunctions-inflight.h
  949. src/database/rrdfunctions-exporters.c
  950. src/database/rrdfunctions-exporters.h
  951. src/database/rrdfunctions-internals.h
  952. src/database/rrdcollector-internals.h
  953. )
  954. if(ENABLE_DBENGINE)
  955. list(APPEND RRD_PLUGIN_FILES
  956. src/database/engine/rrdengine.c
  957. src/database/engine/rrdengine.h
  958. src/database/engine/rrddiskprotocol.h
  959. src/database/engine/datafile.c
  960. src/database/engine/datafile.h
  961. src/database/engine/journalfile.c
  962. src/database/engine/journalfile.h
  963. src/database/engine/rrdenginelib.c
  964. src/database/engine/rrdenginelib.h
  965. src/database/engine/rrdengineapi.c
  966. src/database/engine/rrdengineapi.h
  967. src/database/engine/pagecache.c
  968. src/database/engine/pagecache.h
  969. src/database/engine/page_test.cc
  970. src/database/engine/page.c
  971. src/database/engine/page.h
  972. src/database/engine/cache.c
  973. src/database/engine/cache.h
  974. src/database/engine/metric.c
  975. src/database/engine/metric.h
  976. src/database/engine/pdc.c
  977. src/database/engine/pdc.h
  978. )
  979. endif()
  980. set(REGISTRY_PLUGIN_FILES
  981. src/registry/registry.c
  982. src/registry/registry.h
  983. src/registry/registry_db.c
  984. src/registry/registry_init.c
  985. src/registry/registry_internals.c
  986. src/registry/registry_internals.h
  987. src/registry/registry_log.c
  988. src/registry/registry_machine.c
  989. src/registry/registry_machine.h
  990. src/registry/registry_person.c
  991. src/registry/registry_person.h
  992. )
  993. set(STATSD_PLUGIN_FILES
  994. src/collectors/statsd.plugin/statsd.c
  995. )
  996. set(SYSTEMD_JOURNAL_PLUGIN_FILES
  997. src/collectors/systemd-journal.plugin/systemd-journal.c
  998. src/collectors/systemd-journal.plugin/systemd-internals.h
  999. src/collectors/systemd-journal.plugin/systemd-main.c
  1000. src/collectors/systemd-journal.plugin/systemd-units.c
  1001. src/collectors/systemd-journal.plugin/systemd-journal.c
  1002. src/collectors/systemd-journal.plugin/systemd-journal-annotations.c
  1003. src/collectors/systemd-journal.plugin/systemd-journal-files.c
  1004. src/collectors/systemd-journal.plugin/systemd-journal-fstat.c
  1005. src/collectors/systemd-journal.plugin/systemd-journal-watcher.c
  1006. src/collectors/systemd-journal.plugin/systemd-journal-dyncfg.c
  1007. src/libnetdata/maps/system-users.h
  1008. src/libnetdata/maps/system-groups.h
  1009. )
  1010. set(STREAMING_PLUGIN_FILES
  1011. src/streaming/rrdpush.c
  1012. src/streaming/rrdpush.h
  1013. src/streaming/compression.c
  1014. src/streaming/compression.h
  1015. src/streaming/compression_brotli.c
  1016. src/streaming/compression_brotli.h
  1017. src/streaming/compression_gzip.c
  1018. src/streaming/compression_gzip.h
  1019. src/streaming/compression_lz4.c
  1020. src/streaming/compression_lz4.h
  1021. src/streaming/compression_zstd.c
  1022. src/streaming/compression_zstd.h
  1023. src/streaming/receiver.c
  1024. src/streaming/sender.c
  1025. src/streaming/replication.c
  1026. src/streaming/replication.h
  1027. src/streaming/common.h
  1028. )
  1029. set(WEB_PLUGIN_FILES
  1030. web/server/web_client.c
  1031. web/server/web_client.h
  1032. web/server/web_server.c
  1033. web/server/web_server.h
  1034. web/server/static/static-threaded.c
  1035. web/server/static/static-threaded.h
  1036. web/server/web_client_cache.c
  1037. web/server/web_client_cache.h
  1038. )
  1039. set(CLAIM_PLUGIN_FILES
  1040. src/claim/claim.c
  1041. src/claim/claim.h
  1042. )
  1043. set(SPAWN_PLUGIN_FILES
  1044. src/spawn/spawn.c
  1045. src/spawn/spawn_server.c
  1046. src/spawn/spawn_client.c
  1047. src/spawn/spawn.h
  1048. )
  1049. set(ACLK_ALWAYS_BUILD
  1050. src/aclk/aclk_rrdhost_state.h
  1051. src/aclk/aclk_proxy.c
  1052. src/aclk/aclk_proxy.h
  1053. src/aclk/aclk.c
  1054. src/aclk/aclk.h
  1055. src/aclk/aclk_capas.c
  1056. src/aclk/aclk_capas.h
  1057. src/aclk/aclk_util.c
  1058. src/aclk/aclk_util.h
  1059. src/aclk/https_client.c
  1060. src/aclk/https_client.h
  1061. )
  1062. set(TIMEX_PLUGIN_FILES
  1063. src/collectors/timex.plugin/plugin_timex.c
  1064. )
  1065. set(PROFILE_PLUGIN_FILES
  1066. src/collectors/profile.plugin/plugin_profile.cc
  1067. )
  1068. set(CGROUPS_PLUGIN_FILES
  1069. src/collectors/cgroups.plugin/sys_fs_cgroup.c
  1070. src/collectors/cgroups.plugin/sys_fs_cgroup.h
  1071. src/collectors/cgroups.plugin/cgroup-internals.h
  1072. src/collectors/cgroups.plugin/cgroup-discovery.c
  1073. src/collectors/cgroups.plugin/cgroup-charts.c
  1074. src/collectors/cgroups.plugin/cgroup-top.c
  1075. )
  1076. set(DISKSPACE_PLUGIN_FILES
  1077. src/collectors/diskspace.plugin/plugin_diskspace.c
  1078. )
  1079. set(MACOS_PLUGIN_FILES
  1080. src/collectors/macos.plugin/plugin_macos.c
  1081. src/collectors/macos.plugin/plugin_macos.h
  1082. src/collectors/macos.plugin/macos_sysctl.c
  1083. src/collectors/macos.plugin/macos_mach_smi.c
  1084. src/collectors/macos.plugin/macos_fw.c
  1085. )
  1086. set(FREEBSD_PLUGIN_FILES
  1087. src/collectors/freebsd.plugin/plugin_freebsd.c
  1088. src/collectors/freebsd.plugin/plugin_freebsd.h
  1089. src/collectors/freebsd.plugin/freebsd_sysctl.c
  1090. src/collectors/freebsd.plugin/freebsd_getmntinfo.c
  1091. src/collectors/freebsd.plugin/freebsd_getifaddrs.c
  1092. src/collectors/freebsd.plugin/freebsd_devstat.c
  1093. src/collectors/freebsd.plugin/freebsd_kstat_zfs.c
  1094. src/collectors/freebsd.plugin/freebsd_ipfw.c
  1095. src/collectors/proc.plugin/zfs_common.c
  1096. src/collectors/proc.plugin/zfs_common.h
  1097. )
  1098. set(PROC_PLUGIN_FILES
  1099. src/collectors/proc.plugin/ipc.c
  1100. src/collectors/proc.plugin/plugin_proc.c
  1101. src/collectors/proc.plugin/plugin_proc.h
  1102. src/collectors/proc.plugin/proc_sys_fs_file_nr.c
  1103. src/collectors/proc.plugin/proc_diskstats.c
  1104. src/collectors/proc.plugin/proc_mdstat.c
  1105. src/collectors/proc.plugin/proc_interrupts.c
  1106. src/collectors/proc.plugin/proc_softirqs.c
  1107. src/collectors/proc.plugin/proc_loadavg.c
  1108. src/collectors/proc.plugin/proc_meminfo.c
  1109. src/collectors/proc.plugin/proc_pagetypeinfo.c
  1110. src/collectors/proc.plugin/proc_net_dev.c
  1111. src/collectors/proc.plugin/proc_net_dev_renames.c
  1112. src/collectors/proc.plugin/proc_net_dev_renames.h
  1113. src/collectors/proc.plugin/proc_net_wireless.c
  1114. src/collectors/proc.plugin/proc_net_ip_vs_stats.c
  1115. src/collectors/proc.plugin/proc_net_netstat.c
  1116. src/collectors/proc.plugin/proc_net_rpc_nfs.c
  1117. src/collectors/proc.plugin/proc_net_rpc_nfsd.c
  1118. src/collectors/proc.plugin/proc_net_sctp_snmp.c
  1119. src/collectors/proc.plugin/proc_net_sockstat.c
  1120. src/collectors/proc.plugin/proc_net_sockstat6.c
  1121. src/collectors/proc.plugin/proc_net_softnet_stat.c
  1122. src/collectors/proc.plugin/proc_net_stat_conntrack.c
  1123. src/collectors/proc.plugin/proc_net_stat_synproxy.c
  1124. src/collectors/proc.plugin/proc_self_mountinfo.c
  1125. src/collectors/proc.plugin/proc_self_mountinfo.h
  1126. src/collectors/proc.plugin/zfs_common.c
  1127. src/collectors/proc.plugin/zfs_common.h
  1128. src/collectors/proc.plugin/proc_spl_kstat_zfs.c
  1129. src/collectors/proc.plugin/proc_stat.c
  1130. src/collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  1131. src/collectors/proc.plugin/proc_vmstat.c
  1132. src/collectors/proc.plugin/proc_uptime.c
  1133. src/collectors/proc.plugin/proc_pressure.c
  1134. src/collectors/proc.plugin/proc_pressure.h
  1135. src/collectors/proc.plugin/sys_kernel_mm_ksm.c
  1136. src/collectors/proc.plugin/sys_block_zram.c
  1137. src/collectors/proc.plugin/sys_devices_system_edac_mc.c
  1138. src/collectors/proc.plugin/sys_devices_system_node.c
  1139. src/collectors/proc.plugin/sys_class_infiniband.c
  1140. src/collectors/proc.plugin/sys_fs_btrfs.c
  1141. src/collectors/proc.plugin/sys_class_power_supply.c
  1142. src/collectors/proc.plugin/sys_devices_pci_aer.c
  1143. src/collectors/proc.plugin/sys_class_drm.c
  1144. )
  1145. set(TC_PLUGIN_FILES
  1146. src/collectors/tc.plugin/plugin_tc.c
  1147. )
  1148. set(LOGS_MANAGEMENT_PLUGIN_FILES
  1149. src/logsmanagement/circular_buffer.c
  1150. src/logsmanagement/circular_buffer.h
  1151. src/logsmanagement/db_api.c
  1152. src/logsmanagement/db_api.h
  1153. src/logsmanagement/defaults.h
  1154. src/logsmanagement/file_info.h
  1155. src/logsmanagement/flb_plugin.c
  1156. src/logsmanagement/flb_plugin.h
  1157. src/logsmanagement/functions.c
  1158. src/logsmanagement/functions.h
  1159. src/logsmanagement/helper.h
  1160. src/logsmanagement/logsmanag_config.c
  1161. src/logsmanagement/logsmanag_config.h
  1162. src/logsmanagement/logsmanagement.c
  1163. src/logsmanagement/parser.c
  1164. src/logsmanagement/parser.h
  1165. src/logsmanagement/query.c
  1166. src/logsmanagement/query.h
  1167. src/logsmanagement/rrd_api/rrd_api_docker_ev.c
  1168. src/logsmanagement/rrd_api/rrd_api_docker_ev.h
  1169. src/logsmanagement/rrd_api/rrd_api_generic.c
  1170. src/logsmanagement/rrd_api/rrd_api_generic.h
  1171. src/logsmanagement/rrd_api/rrd_api_kernel.c
  1172. src/logsmanagement/rrd_api/rrd_api_kernel.h
  1173. src/logsmanagement/rrd_api/rrd_api_mqtt.c
  1174. src/logsmanagement/rrd_api/rrd_api_mqtt.h
  1175. src/logsmanagement/rrd_api/rrd_api_stats.c
  1176. src/logsmanagement/rrd_api/rrd_api_stats.h
  1177. src/logsmanagement/rrd_api/rrd_api_systemd.c
  1178. src/logsmanagement/rrd_api/rrd_api_systemd.h
  1179. src/logsmanagement/rrd_api/rrd_api_web_log.c
  1180. src/logsmanagement/rrd_api/rrd_api_web_log.h
  1181. src/logsmanagement/rrd_api/rrd_api.h
  1182. src/database/sqlite/sqlite3.c
  1183. src/database/sqlite/sqlite3.h
  1184. )
  1185. set(NETDATA_FILES
  1186. src/collectors/all.h
  1187. ${DAEMON_FILES}
  1188. ${API_PLUGIN_FILES}
  1189. ${EXPORTING_ENGINE_FILES}
  1190. ${HEALTH_PLUGIN_FILES}
  1191. ${IDLEJITTER_PLUGIN_FILES}
  1192. ${ML_FILES}
  1193. ${PLUGINSD_PLUGIN_FILES}
  1194. ${RRD_PLUGIN_FILES}
  1195. ${REGISTRY_PLUGIN_FILES}
  1196. ${STATSD_PLUGIN_FILES}
  1197. ${STREAMING_PLUGIN_FILES}
  1198. ${WEB_PLUGIN_FILES}
  1199. ${CLAIM_PLUGIN_FILES}
  1200. ${SPAWN_PLUGIN_FILES}
  1201. ${ACLK_ALWAYS_BUILD}
  1202. ${TIMEX_PLUGIN_FILES}
  1203. ${PROFILE_PLUGIN_FILES}
  1204. )
  1205. if(LINUX)
  1206. list(APPEND NETDATA_FILES
  1207. src/daemon/static_threads_linux.c
  1208. ${CGROUPS_PLUGIN_FILES}
  1209. ${DISKSPACE_PLUGIN_FILES}
  1210. ${PROC_PLUGIN_FILES}
  1211. ${TC_PLUGIN_FILES}
  1212. )
  1213. if(ENABLE_SENTRY)
  1214. list(APPEND NETDATA_FILES
  1215. src/daemon/sentry-native/sentry-native.c
  1216. src/daemon/sentry-native/sentry-native.h)
  1217. endif()
  1218. elseif(MACOS)
  1219. list(APPEND NETDATA_FILES
  1220. src/daemon/static_threads_macos.c
  1221. ${MACOS_PLUGIN_FILES}
  1222. )
  1223. elseif(FREEBSD)
  1224. list(APPEND NETDATA_FILES
  1225. src/daemon/static_threads_freebsd.c
  1226. ${FREEBSD_PLUGIN_FILES}
  1227. )
  1228. endif()
  1229. set(MQTT_WEBSOCKETS_FILES
  1230. src/aclk/mqtt_websockets/mqtt_wss_client.c
  1231. src/aclk/mqtt_websockets/mqtt_wss_client.h
  1232. src/aclk/mqtt_websockets/mqtt_wss_log.c
  1233. src/aclk/mqtt_websockets/mqtt_wss_log.h
  1234. src/aclk/mqtt_websockets/ws_client.c
  1235. src/aclk/mqtt_websockets/ws_client.h
  1236. src/aclk/mqtt_websockets/mqtt_ng.c
  1237. src/aclk/mqtt_websockets/mqtt_ng.h
  1238. src/aclk/mqtt_websockets/common_public.c
  1239. src/aclk/mqtt_websockets/common_public.h
  1240. src/aclk/mqtt_websockets/common_internal.h
  1241. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.c
  1242. src/aclk/mqtt_websockets/c-rbuf/cringbuffer.h
  1243. src/aclk/mqtt_websockets/c-rbuf/cringbuffer_internal.h
  1244. src/aclk/mqtt_websockets/c_rhash/c_rhash.c
  1245. src/aclk/mqtt_websockets/c_rhash/c_rhash.h
  1246. src/aclk/mqtt_websockets/c_rhash/c_rhash_internal.h
  1247. )
  1248. set(ACLK_PROTO_DEFS
  1249. src/aclk/aclk-schemas/proto/aclk/v1/lib.proto
  1250. src/aclk/aclk-schemas/proto/agent/v1/disconnect.proto
  1251. src/aclk/aclk-schemas/proto/agent/v1/connection.proto
  1252. src/aclk/aclk-schemas/proto/alarm/v1/config.proto
  1253. src/aclk/aclk-schemas/proto/alarm/v1/stream.proto
  1254. src/aclk/aclk-schemas/proto/nodeinstance/connection/v1/connection.proto
  1255. src/aclk/aclk-schemas/proto/nodeinstance/create/v1/creation.proto
  1256. src/aclk/aclk-schemas/proto/nodeinstance/info/v1/info.proto
  1257. src/aclk/aclk-schemas/proto/context/v1/context.proto
  1258. src/aclk/aclk-schemas/proto/context/v1/stream.proto
  1259. src/aclk/aclk-schemas/proto/agent/v1/cmds.proto
  1260. )
  1261. set(ACLK_FILES
  1262. src/aclk/aclk_stats.c
  1263. src/aclk/aclk_stats.h
  1264. src/aclk/aclk_query.c
  1265. src/aclk/aclk_query.h
  1266. src/aclk/aclk_query_queue.c
  1267. src/aclk/aclk_query_queue.h
  1268. src/aclk/aclk_otp.c
  1269. src/aclk/aclk_otp.h
  1270. src/aclk/aclk_tx_msgs.c
  1271. src/aclk/aclk_tx_msgs.h
  1272. src/aclk/aclk_rx_msgs.c
  1273. src/aclk/aclk_rx_msgs.h
  1274. src/aclk/aclk_alarm_api.c
  1275. src/aclk/aclk_alarm_api.h
  1276. src/aclk/aclk_contexts_api.c
  1277. src/aclk/aclk_contexts_api.h
  1278. src/aclk/schema-wrappers/connection.cc
  1279. src/aclk/schema-wrappers/connection.h
  1280. src/aclk/schema-wrappers/node_connection.cc
  1281. src/aclk/schema-wrappers/node_connection.h
  1282. src/aclk/schema-wrappers/node_creation.cc
  1283. src/aclk/schema-wrappers/node_creation.h
  1284. src/aclk/schema-wrappers/alarm_stream.cc
  1285. src/aclk/schema-wrappers/alarm_stream.h
  1286. src/aclk/schema-wrappers/alarm_config.cc
  1287. src/aclk/schema-wrappers/alarm_config.h
  1288. src/aclk/schema-wrappers/node_info.cc
  1289. src/aclk/schema-wrappers/node_info.h
  1290. src/aclk/schema-wrappers/capability.cc
  1291. src/aclk/schema-wrappers/capability.h
  1292. src/aclk/schema-wrappers/proto_2_json.cc
  1293. src/aclk/schema-wrappers/proto_2_json.h
  1294. src/aclk/schema-wrappers/context_stream.cc
  1295. src/aclk/schema-wrappers/context_stream.h
  1296. src/aclk/schema-wrappers/context.cc
  1297. src/aclk/schema-wrappers/context.h
  1298. src/aclk/schema-wrappers/schema_wrappers.h
  1299. src/aclk/schema-wrappers/schema_wrapper_utils.cc
  1300. src/aclk/schema-wrappers/schema_wrapper_utils.h
  1301. src/aclk/schema-wrappers/agent_cmds.cc
  1302. src/aclk/schema-wrappers/agent_cmds.h
  1303. src/aclk/helpers/mqtt_wss_pal.h
  1304. src/aclk/helpers/ringbuffer_pal.h
  1305. )
  1306. set(MONGODB_EXPORTING_FILES
  1307. src/exporting/mongodb/mongodb.c
  1308. src/exporting/mongodb/mongodb.h
  1309. )
  1310. set(PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1311. src/exporting/prometheus/remote_write/remote_write.c
  1312. src/exporting/prometheus/remote_write/remote_write.h
  1313. src/exporting/prometheus/remote_write/remote_write_request.cc
  1314. src/exporting/prometheus/remote_write/remote_write_request.h
  1315. )
  1316. #
  1317. # build h2o
  1318. #
  1319. if(ENABLE_H2O)
  1320. add_library(h2o STATIC ${LIBH2O_FILES})
  1321. target_include_directories(h2o BEFORE PUBLIC
  1322. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/include"
  1323. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/cloexec"
  1324. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/brotli/enc"
  1325. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/golombset"
  1326. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/libgkc"
  1327. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/libyrmcds"
  1328. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/klib"
  1329. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/neverbleed"
  1330. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/picohttpparser"
  1331. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/picotest"
  1332. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/yaml/include"
  1333. "${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/deps/yoml"
  1334. )
  1335. target_compile_options(h2o PRIVATE
  1336. -Wno-all -Wno-extra
  1337. -Wno-shadow
  1338. -Wno-deprecated-declarations
  1339. -Wformat
  1340. )
  1341. target_compile_options(h2o PUBLIC -DH2O_USE_LIBUV=0)
  1342. target_include_directories(h2o BEFORE PRIVATE ${OPENSSL_INCLUDE_DIRS})
  1343. target_compile_options(h2o PRIVATE ${OPENSSL_CFLAGS_OTHER})
  1344. target_link_libraries(h2o PRIVATE ${OPENSSL_LIBRARIES})
  1345. endif()
  1346. #
  1347. # build libjudy
  1348. #
  1349. add_library(judy STATIC ${LIBJUDY_SOURCES})
  1350. target_compile_options(judy PRIVATE
  1351. -Wno-all -Wno-extra
  1352. -Wno-shadow
  1353. -Wformat
  1354. )
  1355. target_compile_definitions(judy PRIVATE
  1356. JUDYL
  1357. $<$<EQUAL:${CMAKE_SIZEOF_VOID_P},8>:JU_64BIT>
  1358. )
  1359. target_include_directories(judy PUBLIC
  1360. src/libnetdata/libjudy/src
  1361. src/libnetdata/libjudy/src/JudyCommon
  1362. )
  1363. set_source_files_properties(${LIBJUDY_PREV_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYPREV")
  1364. set_source_files_properties(${LIBJUDY_NEXT_FILES} PROPERTIES COMPILE_OPTIONS "-DJUDYNEXT")
  1365. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/j__udyLGet.c PROPERTIES COMPILE_OPTIONS "-DJUDYGETINLINE")
  1366. set_source_files_properties(src/libnetdata/libjudy/src/JudyL/JudyLByCount.c PROPERTIES COMPILE_OPTIONS "-DNOSMARTJBB -DNOSMARTJBU -DNOSMARTJLB")
  1367. set_source_files_properties(JudyLTables.c PROPERTIES COMPILE_OPTIONS "-I${CMAKE_SOURCE_DIR}/src/libnetdata/libjudy/src/JudyL")
  1368. #
  1369. # build libnetdata
  1370. #
  1371. include(systemd.cmake)
  1372. add_library(libnetdata STATIC ${LIBNETDATA_FILES})
  1373. target_include_directories(libnetdata BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src)
  1374. # pthread (FIXME: use find_package for this)
  1375. # set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
  1376. # set(THREADS_PREFER_PTHREAD_FLAG TRUE)
  1377. # find_package(Threads REQUIRED)
  1378. # add_executable(test test.cpp)
  1379. # target_link_libraries(test Threads::Threads)
  1380. target_link_libraries(libnetdata PUBLIC
  1381. "$<$<NOT:$<BOOL:${HAVE_BUILTIN_ATOMICS}>>:atomic>"
  1382. "$<$<OR:$<BOOL:${LINUX}>,$<BOOL:${FREEBSD}>>:pthread;rt>"
  1383. "$<$<BOOL:${LINK_LIBM}>:m>"
  1384. "${SYSTEMD_LDFLAGS}")
  1385. # ebpf
  1386. if(ENABLE_PLUGIN_EBPF)
  1387. target_link_libraries(libnetdata PUBLIC ${CMAKE_SOURCE_DIR}/externaldeps/libbpf/libbpf.a)
  1388. target_include_directories(libnetdata BEFORE PUBLIC
  1389. ${CMAKE_SOURCE_DIR}/externaldeps/libbpf/include
  1390. ${CMAKE_SOURCE_DIR}/externaldeps/libbpf/include/uapi
  1391. )
  1392. pkg_check_modules(ELF REQUIRED libelf)
  1393. target_include_directories(libnetdata BEFORE PUBLIC ${ELF_INCLUDE_DIRS})
  1394. target_compile_options(libnetdata PUBLIC ${ELF_CFLAGS_OTHER})
  1395. target_link_libraries(libnetdata PUBLIC ${ELF_LIBRARIES})
  1396. endif()
  1397. # judy
  1398. target_link_libraries(libnetdata PUBLIC judy)
  1399. # json-c
  1400. if(ENABLE_BUNDLED_JSONC)
  1401. add_library(jsonc STATIC IMPORTED)
  1402. set_property(TARGET jsonc PROPERTY
  1403. IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/externaldeps/jsonc/libjson-c.a")
  1404. target_include_directories(libnetdata BEFORE PUBLIC "${CMAKE_SOURCE_DIR}/externaldeps/jsonc")
  1405. target_link_libraries(libnetdata PUBLIC jsonc)
  1406. else()
  1407. pkg_check_modules(JSONC REQUIRED json-c)
  1408. target_include_directories(libnetdata BEFORE PUBLIC ${JSONC_INCLUDE_DIRS})
  1409. target_compile_definitions(libnetdata PUBLIC ${JSONC_CFLAGS_OTHER})
  1410. target_link_libraries(libnetdata PUBLIC ${JSONC_LDFLAGS})
  1411. endif()
  1412. # message(FATAL_ERROR "jsonc libraries: ${JSONC_LIBRARIES}")
  1413. # message(FATAL_ERROR "jsonc ldflags: ${JSONC_LDFLAGS}")
  1414. # yaml
  1415. set(HAVE_LIBYAML True)
  1416. if(ENABLE_BUNDLED_YAML)
  1417. add_library(yaml STATIC IMPORTED)
  1418. set_property(TARGET yaml PROPERTY
  1419. IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/externaldeps/libyaml/libyaml.a")
  1420. target_include_directories(libnetdata BEFORE PUBLIC "${CMAKE_SOURCE_DIR}/externaldeps/libyaml")
  1421. target_link_libraries(libnetdata PUBLIC yaml)
  1422. else()
  1423. pkg_check_modules(YAML REQUIRED yaml-0.1)
  1424. target_include_directories(libnetdata BEFORE PUBLIC ${YAML_INCLUDE_DIRS})
  1425. target_compile_definitions(libnetdata PUBLIC ${YAML_CFLAGS_OTHER})
  1426. target_link_libraries(libnetdata PUBLIC ${YAML_LDFLAGS})
  1427. endif()
  1428. # zlib
  1429. pkg_check_modules(ZLIB REQUIRED zlib)
  1430. target_include_directories(libnetdata BEFORE PUBLIC ${ZLIB_INCLUDE_DIRS})
  1431. target_compile_definitions(libnetdata PUBLIC ${ZLIB_CFLAGS_OTHER})
  1432. target_link_libraries(libnetdata PUBLIC ${ZLIB_LDFLAGS})
  1433. # lz4 - try to find a version that is compatible with streaming compression
  1434. # otherwise pick whichever one we can find to support dbengine but don't set
  1435. # ENABLE_LZ4.
  1436. pkg_check_modules(LIBLZ4 liblz4>=1.9.0)
  1437. if(LIBLZ4_FOUND)
  1438. set(ENABLE_LZ4 On)
  1439. else()
  1440. pkg_check_modules(LIBLZ4 REQUIRED liblz4)
  1441. endif()
  1442. target_include_directories(libnetdata BEFORE PUBLIC ${LIBLZ4_INCLUDE_DIRS})
  1443. target_compile_definitions(libnetdata PUBLIC ${LIBLZ4_CFLAGS_OTHER})
  1444. target_link_libraries(libnetdata PUBLIC ${LIBLZ4_LDFLAGS})
  1445. # zstd
  1446. pkg_check_modules(LIBZSTD libzstd)
  1447. if(LIBZSTD_FOUND)
  1448. set(ENABLE_ZSTD On)
  1449. target_include_directories(libnetdata BEFORE PUBLIC ${LIBZSTD_INCLUDE_DIRS})
  1450. target_compile_definitions(libnetdata PUBLIC ${LIBZSTD_CFLAGS_OTHER})
  1451. target_link_libraries(libnetdata PUBLIC ${LIBZSTD_LDFLAGS})
  1452. endif()
  1453. # brotli
  1454. pkg_check_modules(LIBBROTLI libbrotlidec libbrotlienc libbrotlicommon)
  1455. if(LIBBROTLI_FOUND)
  1456. set(ENABLE_BROTLI On)
  1457. target_include_directories(libnetdata BEFORE PUBLIC ${LIBBROTLI_INCLUDE_DIRS})
  1458. target_compile_definitions(libnetdata PUBLIC ${LIBBROTLI_CFLAGS_OTHER})
  1459. target_link_libraries(libnetdata PUBLIC ${LIBBROTLI_LDFLAGS})
  1460. endif()
  1461. # uuid
  1462. pkg_check_modules(UUID REQUIRED uuid)
  1463. target_include_directories(libnetdata BEFORE PUBLIC ${UUID_INCLUDE_DIRS})
  1464. target_compile_definitions(libnetdata PUBLIC ${UUID_CFLAGS_OTHER})
  1465. target_link_libraries(libnetdata PUBLIC ${UUID_LDFLAGS})
  1466. # uv
  1467. pkg_check_modules(LIBUV REQUIRED libuv)
  1468. target_include_directories(libnetdata BEFORE PUBLIC ${LIBUV_INCLUDE_DIRS})
  1469. target_compile_definitions(libnetdata PUBLIC ${LIBUV_CFLAGS_OTHER})
  1470. target_link_libraries(libnetdata PUBLIC ${LIBUV_LDFLAGS})
  1471. # crypto
  1472. target_include_directories(libnetdata BEFORE PUBLIC ${CRYPTO_INCLUDE_DIRS})
  1473. target_compile_options(libnetdata PUBLIC ${CRYPTO_CFLAGS_OTHER})
  1474. target_link_libraries(libnetdata PUBLIC ${CRYPTO_LDFLAGS})
  1475. # openssl
  1476. target_include_directories(libnetdata BEFORE PUBLIC ${OPENSSL_INCLUDE_DIRS})
  1477. target_compile_options(libnetdata PUBLIC ${OPENSSL_CFLAGS_OTHER})
  1478. target_link_libraries(libnetdata PUBLIC ${OPENSSL_LDFLAGS})
  1479. # h2o
  1480. target_link_libraries(libnetdata PUBLIC "$<$<BOOL:${ENABLE_H2O}>:h2o>")
  1481. # mnl
  1482. pkg_check_modules(MNL libmnl)
  1483. if(MNL_FOUND)
  1484. set(HAVE_LIBMNL True)
  1485. endif()
  1486. #
  1487. # helper function to build protos
  1488. #
  1489. function(protoc_generate_cpp INC_DIR OUT_DIR SRCS HDRS)
  1490. if(NOT ARGN)
  1491. message(SEND_ERROR "Error: protoc_generate_cpp() called without any proto files")
  1492. return()
  1493. endif()
  1494. set(${INC_DIR})
  1495. set(${OUT_DIR})
  1496. set(${SRCS})
  1497. set(${HDRS})
  1498. foreach(FIL ${ARGN})
  1499. get_filename_component(ABS_FIL ${FIL} ABSOLUTE)
  1500. get_filename_component(DIR ${ABS_FIL} DIRECTORY)
  1501. get_filename_component(FIL_WE ${FIL} NAME_WE)
  1502. set(GENERATED_PB_CC "${DIR}/${FIL_WE}.pb.cc")
  1503. list(APPEND ${SRCS} ${GENERATED_PB_CC})
  1504. set(GENERATED_PB_H "${DIR}/${FIL_WE}.pb.h")
  1505. list(APPEND ${HDRS} ${GENERATED_PB_H})
  1506. add_custom_command(OUTPUT ${GENERATED_PB_CC} ${GENERATED_PB_H}
  1507. COMMAND ${PROTOBUF_PROTOC_EXECUTABLE} ARGS -I=${INC_DIR} --cpp_out=${OUT_DIR} ${ABS_FIL}
  1508. DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
  1509. COMMENT "Running C++ protocol buffer compiler on ${FIL}"
  1510. VERBATIM)
  1511. endforeach()
  1512. set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES GENERATED TRUE)
  1513. set_source_files_properties(${${SRCS}} ${${HDRS}} PROPERTIES COMPILE_OPTIONS -Wno-deprecated-declarations)
  1514. set(${SRCS} ${${SRCS}} PARENT_SCOPE)
  1515. set(${HDRS} ${${HDRS}} PARENT_SCOPE)
  1516. endfunction()
  1517. #
  1518. # mqtt library
  1519. #
  1520. if (ENABLE_H2O OR ENABLE_ACLK)
  1521. set(ENABLE_MQTTWEBSOCKETS True)
  1522. endif()
  1523. if(ENABLE_MQTTWEBSOCKETS)
  1524. # include_directories(BEFORE
  1525. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/src/include
  1526. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/c-rbuf/include
  1527. # ${CMAKE_SOURCE_DIR}/aclk/mqtt_websockets/c_rhash/include
  1528. # )
  1529. add_library(mqttwebsockets STATIC ${MQTT_WEBSOCKETS_FILES})
  1530. target_compile_options(mqttwebsockets PUBLIC -DMQTT_WSS_CUSTOM_ALLOC
  1531. -DRBUF_CUSTOM_MALLOC
  1532. -DMQTT_WSS_CPUSTATS)
  1533. target_include_directories(mqttwebsockets PUBLIC ${CMAKE_SOURCE_DIR}/aclk/helpers
  1534. ${CMAKE_SOURCE_DIR}/web/server/h2o/libh2o/include)
  1535. target_link_libraries(mqttwebsockets PRIVATE libnetdata)
  1536. endif()
  1537. if(ENABLE_ACLK)
  1538. #
  1539. # proto definitions
  1540. #
  1541. protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1542. "${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas"
  1543. ACLK_PROTO_BUILT_SRCS
  1544. ACLK_PROTO_BUILT_HDRS
  1545. ${ACLK_PROTO_DEFS})
  1546. list(APPEND ACLK_FILES ${ACLK_PROTO_BUILT_SRCS}
  1547. ${ACLK_PROTO_BUILT_HDRS})
  1548. endif()
  1549. #
  1550. # build plugins
  1551. #
  1552. if(ENABLE_PLUGIN_DEBUGFS)
  1553. pkg_check_modules(CAP QUIET libcap)
  1554. set(DEBUGFS_PLUGIN_FILES src/collectors/debugfs.plugin/debugfs_plugin.c
  1555. src/collectors/debugfs.plugin/debugfs_plugin.h
  1556. src/collectors/debugfs.plugin/debugfs_extfrag.c
  1557. src/collectors/debugfs.plugin/debugfs_zswap.c
  1558. src/collectors/debugfs.plugin/sys_devices_virtual_powercap.c)
  1559. add_executable(debugfs.plugin ${DEBUGFS_PLUGIN_FILES})
  1560. target_link_libraries(debugfs.plugin libnetdata ${CAP_LIBRARIES})
  1561. target_include_directories(debugfs.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1562. target_compile_options(debugfs.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1563. install(TARGETS debugfs.plugin
  1564. COMPONENT debugfs_plugin
  1565. DESTINATION usr/libexec/netdata/plugins.d)
  1566. endif()
  1567. if(ENABLE_PLUGIN_APPS)
  1568. pkg_check_modules(CAP QUIET libcap)
  1569. set(APPS_PLUGIN_FILES src/collectors/apps.plugin/apps_plugin.c)
  1570. add_executable(apps.plugin ${APPS_PLUGIN_FILES})
  1571. target_link_libraries(apps.plugin libnetdata ${CAP_LIBRARIES})
  1572. target_include_directories(apps.plugin PRIVATE ${CAP_INCLUDE_DIRS})
  1573. target_compile_options(apps.plugin PRIVATE ${CAP_CFLAGS_OTHER})
  1574. install(TARGETS apps.plugin
  1575. COMPONENT apps_plugin
  1576. DESTINATION usr/libexec/netdata/plugins.d)
  1577. install(FILES src/collectors/apps.plugin/apps_groups.conf
  1578. COMPONENT apps_plugin
  1579. DESTINATION usr/lib/netdata/conf.d)
  1580. endif()
  1581. if(CAP_FOUND)
  1582. set(HAVE_CAPABILITY True)
  1583. endif()
  1584. if(ENABLE_PLUGIN_FREEIPMI)
  1585. pkg_check_modules(IPMI REQUIRED libipmimonitoring)
  1586. set(FREEIPMI_PLUGIN_FILES src/collectors/freeipmi.plugin/freeipmi_plugin.c)
  1587. add_executable(freeipmi.plugin ${FREEIPMI_PLUGIN_FILES})
  1588. target_link_libraries (freeipmi.plugin libnetdata ${IPMI_LIBRARIES})
  1589. target_include_directories(freeipmi.plugin PRIVATE ${IPMI_INCLUDE_DIRS})
  1590. target_compile_options(freeipmi.plugin PRIVATE ${IPMI_CFLAGS_OTHER})
  1591. install(TARGETS freeipmi.plugin
  1592. COMPONENT freeipmi_plugin
  1593. DESTINATION usr/libexec/netdata/plugins.d)
  1594. endif()
  1595. if(ENABLE_PLUGIN_NFACCT)
  1596. if (NOT MNL_FOUND)
  1597. message(FATAL_ERROR "Can not build nfacct.plugin because MNL library could not be found.")
  1598. endif()
  1599. pkg_check_modules(NFACCT REQUIRED libnetfilter_acct)
  1600. set(NFACCT_PLUGIN_FILES src/collectors/nfacct.plugin/plugin_nfacct.c)
  1601. add_executable(nfacct.plugin ${NFACCT_PLUGIN_FILES})
  1602. target_link_libraries (nfacct.plugin libnetdata ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  1603. target_include_directories(nfacct.plugin PRIVATE ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  1604. target_compile_options(nfacct.plugin PRIVATE ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  1605. install(TARGETS nfacct.plugin
  1606. COMPONENT nfacct_plugin
  1607. DESTINATION usr/libexec/netdata/plugins.d)
  1608. endif()
  1609. if(ENABLE_PLUGIN_XENSTAT)
  1610. pkg_check_modules(XENSTAT REQUIRED xenstat)
  1611. pkg_check_modules(XENLIGHT REQUIRED xenlight)
  1612. set(XENSTAT_PLUGIN_FILES src/collectors/xenstat.plugin/xenstat_plugin.c)
  1613. add_executable(xenstat.plugin ${XENSTAT_PLUGIN_FILES})
  1614. target_link_libraries (xenstat.plugin libnetdata ${XENLIGHT_LIBRARIES} ${XENSTAT_LIBRARIES})
  1615. target_include_directories(xenstat.plugin PRIVATE ${XENLIGHT_INCLUDE_DIRS} ${XENSTAT_INCLUDE_DIRS})
  1616. target_compile_options(xenstat.plugin PRIVATE ${XENLIGHT_CFLAGS_OTHER} ${XENSTAT_CFLAGS_OTHER})
  1617. install(TARGETS xenstat.plugin
  1618. COMPONENT xenstat_plugin
  1619. DESTINATION usr/libexec/netdata/plugins.d)
  1620. endif()
  1621. if(ENABLE_PLUGIN_PERF)
  1622. set(PERF_PLUGIN_FILES src/collectors/perf.plugin/perf_plugin.c)
  1623. add_executable(perf.plugin ${PERF_PLUGIN_FILES})
  1624. target_link_libraries(perf.plugin libnetdata)
  1625. install(TARGETS perf.plugin
  1626. COMPONENT perf_plugin
  1627. DESTINATION usr/libexec/netdata/plugins.d)
  1628. endif()
  1629. if(ENABLE_PLUGIN_SLABINFO)
  1630. set(SLABINFO_PLUGIN_FILES src/collectors/slabinfo.plugin/slabinfo.c)
  1631. add_executable(slabinfo.plugin ${SLABINFO_PLUGIN_FILES})
  1632. target_link_libraries(slabinfo.plugin libnetdata)
  1633. install(TARGETS slabinfo.plugin
  1634. COMPONENT slabinfo_plugin
  1635. DESTINATION usr/libexec/netdata/plugins.d)
  1636. endif()
  1637. if(ENABLE_PLUGIN_LOGS_MANAGEMENT)
  1638. set(ENABLE_LOGSMANAGEMENT True)
  1639. if(ENABLE_LOGS_MANAGEMENT_TESTS)
  1640. list(APPEND LOGS_MANAGEMENT_PLUGIN_FILES src/logsmanagement/unit_test/unit_test.c
  1641. src/logsmanagement/unit_test/unit_test.h)
  1642. set(ENABLE_LOGSMANAGEMENT_TESTS True)
  1643. endif()
  1644. add_executable(logs-management.plugin ${LOGS_MANAGEMENT_PLUGIN_FILES})
  1645. target_link_libraries(logs-management.plugin libnetdata)
  1646. install(TARGETS logs-management.plugin
  1647. COMPONENT logs_management_plugin
  1648. DESTINATION usr/libexec/netdata/plugins.d)
  1649. install(DIRECTORY src/logsmanagement/stock_conf/logsmanagement.d
  1650. COMPONENT logs_management_plugin
  1651. DESTINATION usr/lib/netdata/conf.d)
  1652. install(DIRECTORY DESTINATION etc/netdata/logsmanagement.d)
  1653. endif()
  1654. if(ENABLE_PLUGIN_CUPS)
  1655. pkg_check_modules(CUPS libcups)
  1656. if(NOT CUPS_LIBRARIES)
  1657. pkg_check_modules(CUPS cups)
  1658. if(NOT CUPS_LIBRARIES)
  1659. find_program(CUPS_CONFIG cups-config)
  1660. if(CUPS_CONFIG)
  1661. execute_process(COMMAND ${CUPS_CONFIG} --api-version OUTPUT_VARIABLE CUPS_API_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
  1662. if(CUPS_API_VERSION VERSION_LESS "1.7")
  1663. set(CUPS_FOUND False)
  1664. else()
  1665. execute_process(COMMAND ${CUPS_CONFIG} --cflags OUTPUT_VARIABLE CUPS_CFLAGS_OTHER OUTPUT_STRIP_TRAILING_WHITESPACE)
  1666. execute_process(COMMAND ${CUPS_CONFIG} --libs OUTPUT_VARIABLE CUPS_LIBRARIES OUTPUT_STRIP_TRAILING_WHITESPACE)
  1667. set(CUPS_FOUND True)
  1668. endif()
  1669. endif()
  1670. endif()
  1671. endif()
  1672. if(NOT CUPS_FOUND)
  1673. message(WARNING "Could not find cups cflags and libs.")
  1674. else()
  1675. set(CUPS_PLUGIN_FILES src/collectors/cups.plugin/cups_plugin.c)
  1676. add_executable(cups.plugin ${CUPS_PLUGIN_FILES})
  1677. target_link_libraries (cups.plugin libnetdata ${CUPS_LIBRARIES})
  1678. target_compile_options(cups.plugin PRIVATE ${CUPS_CFLAGS_OTHER})
  1679. install(TARGETS cups.plugin
  1680. COMPONENT cups_plugin
  1681. DESTINATION usr/libexec/netdata/plugins.d)
  1682. endif()
  1683. endif()
  1684. set(NDSUDO_FILES src/collectors/plugins.d/ndsudo.c)
  1685. add_executable(ndsudo ${NDSUDO_FILES})
  1686. install(TARGETS ndsudo
  1687. COMPONENT ndsudo
  1688. DESTINATION usr/libexec/netdata/plugins.d)
  1689. if(ENABLE_PLUGIN_CGROUP_NETWORK)
  1690. set(CGROUP_NETWORK_FILES src/collectors/cgroups.plugin/cgroup-network.c)
  1691. add_executable(cgroup-network ${CGROUP_NETWORK_FILES})
  1692. target_link_libraries(cgroup-network libnetdata)
  1693. install(TARGETS cgroup-network
  1694. COMPONENT cgroup_network_plugin
  1695. DESTINATION usr/libexec/netdata/plugins.d)
  1696. endif()
  1697. if(ENABLE_PLUGIN_SYSTEMD_JOURNAL)
  1698. add_executable(systemd-journal.plugin ${SYSTEMD_JOURNAL_PLUGIN_FILES})
  1699. target_link_libraries(systemd-journal.plugin libnetdata)
  1700. install(TARGETS systemd-journal.plugin
  1701. COMPONENT systemd_journal_plugin
  1702. DESTINATION usr/libexec/netdata/plugins.d)
  1703. endif()
  1704. if(ENABLE_PLUGIN_EBPF)
  1705. set(EBPF_PLUGIN_FILES
  1706. src/collectors/ebpf.plugin/ebpf.c
  1707. src/collectors/ebpf.plugin/ebpf.h
  1708. src/collectors/ebpf.plugin/ebpf_cachestat.c
  1709. src/collectors/ebpf.plugin/ebpf_cachestat.h
  1710. src/collectors/ebpf.plugin/ebpf_dcstat.c
  1711. src/collectors/ebpf.plugin/ebpf_dcstat.h
  1712. src/collectors/ebpf.plugin/ebpf_disk.c
  1713. src/collectors/ebpf.plugin/ebpf_disk.h
  1714. src/collectors/ebpf.plugin/ebpf_fd.c
  1715. src/collectors/ebpf.plugin/ebpf_fd.h
  1716. src/collectors/ebpf.plugin/ebpf_hardirq.c
  1717. src/collectors/ebpf.plugin/ebpf_hardirq.h
  1718. src/collectors/ebpf.plugin/ebpf_mdflush.c
  1719. src/collectors/ebpf.plugin/ebpf_mdflush.h
  1720. src/collectors/ebpf.plugin/ebpf_mount.c
  1721. src/collectors/ebpf.plugin/ebpf_mount.h
  1722. src/collectors/ebpf.plugin/ebpf_filesystem.c
  1723. src/collectors/ebpf.plugin/ebpf_filesystem.h
  1724. src/collectors/ebpf.plugin/ebpf_oomkill.c
  1725. src/collectors/ebpf.plugin/ebpf_oomkill.h
  1726. src/collectors/ebpf.plugin/ebpf_process.c
  1727. src/collectors/ebpf.plugin/ebpf_process.h
  1728. src/collectors/ebpf.plugin/ebpf_shm.c
  1729. src/collectors/ebpf.plugin/ebpf_shm.h
  1730. src/collectors/ebpf.plugin/ebpf_socket.c
  1731. src/collectors/ebpf.plugin/ebpf_socket.h
  1732. src/collectors/ebpf.plugin/ebpf_softirq.c
  1733. src/collectors/ebpf.plugin/ebpf_softirq.h
  1734. src/collectors/ebpf.plugin/ebpf_sync.c
  1735. src/collectors/ebpf.plugin/ebpf_sync.h
  1736. src/collectors/ebpf.plugin/ebpf_swap.c
  1737. src/collectors/ebpf.plugin/ebpf_swap.h
  1738. src/collectors/ebpf.plugin/ebpf_vfs.c
  1739. src/collectors/ebpf.plugin/ebpf_vfs.h
  1740. src/collectors/ebpf.plugin/ebpf_apps.c
  1741. src/collectors/ebpf.plugin/ebpf_apps.h
  1742. src/collectors/ebpf.plugin/ebpf_cgroup.c
  1743. src/collectors/ebpf.plugin/ebpf_cgroup.h
  1744. src/collectors/ebpf.plugin/ebpf_unittest.c
  1745. src/collectors/ebpf.plugin/ebpf_unittest.h
  1746. src/collectors/ebpf.plugin/ebpf_functions.c
  1747. src/collectors/ebpf.plugin/ebpf_functions.h
  1748. )
  1749. add_executable(ebpf.plugin ${EBPF_PLUGIN_FILES})
  1750. target_link_libraries(ebpf.plugin libnetdata)
  1751. install(TARGETS ebpf.plugin
  1752. COMPONENT ebpf_plugin
  1753. DESTINATION usr/libexec/netdata/plugins.d)
  1754. endif()
  1755. if(ENABLE_PLUGIN_LOCAL_LISTENERS)
  1756. set(LOCAL_LISTENERS_FILES
  1757. src/collectors/plugins.d/local_listeners.c
  1758. src/libnetdata/maps/local-sockets.h
  1759. )
  1760. add_executable(local-listeners ${LOCAL_LISTENERS_FILES})
  1761. target_compile_options(local-listeners PRIVATE
  1762. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1763. target_include_directories(local-listeners PRIVATE
  1764. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1765. target_link_libraries(local-listeners libnetdata
  1766. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1767. install(TARGETS local-listeners
  1768. COMPONENT local_listeners
  1769. DESTINATION usr/libexec/netdata/plugins.d)
  1770. endif()
  1771. if(ENABLE_PLUGIN_NETWORK_VIEWER)
  1772. set(NETWORK_VIEWER_FILES
  1773. src/libnetdata/maps/local-sockets.h
  1774. src/libnetdata/maps/system-users.h
  1775. src/collectors/network-viewer.plugin/network-viewer.c
  1776. )
  1777. add_executable(network-viewer.plugin ${NETWORK_VIEWER_FILES})
  1778. target_compile_options(network-viewer.plugin PRIVATE
  1779. "$<$<BOOL:${MNL_FOUND}>:${MNL_CFLAGS_OTHER}>")
  1780. target_include_directories(network-viewer.plugin PRIVATE
  1781. "$<$<BOOL:${MNL_FOUND}>:${MNL_INCLUDE_DIRS}>")
  1782. target_link_libraries(network-viewer.plugin libnetdata
  1783. "$<$<BOOL:${MNL_FOUND}>:${MNL_LIBRARIES}>")
  1784. install(TARGETS network-viewer.plugin
  1785. COMPONENT network_viewer_plugin
  1786. DESTINATION usr/libexec/netdata/plugins.d)
  1787. endif()
  1788. #
  1789. # exporters
  1790. #
  1791. if(ENABLE_EXPORTER_MONGODB)
  1792. pkg_check_modules(MONGOC libmongoc-1.0>=1.7)
  1793. if(MONGOC_FOUND)
  1794. SET(HAVE_MONGOC True)
  1795. else()
  1796. SET(ENABLE_EXPORTER_MONGODB False)
  1797. endif()
  1798. endif()
  1799. if(ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE)
  1800. pkg_check_modules(SNAPPY snappy)
  1801. if (NOT SNAPPY_FOUND)
  1802. if(HAVE_SNAPPY_LIB)
  1803. set(SNAPPY_INCLUDE_DIRS "")
  1804. set(SNAPPY_CFLAGS_OTHER "")
  1805. set(SNAPPY_LIBRARIES "-lsnappy")
  1806. else()
  1807. message(FATAL_ERROR "Could not find snappy libraries with pkg-config or internal cmake checks.")
  1808. endif()
  1809. endif()
  1810. protoc_generate_cpp("${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1811. "${CMAKE_SOURCE_DIR}/src/exporting/prometheus/remote_write"
  1812. PROMETHEUS_REMOTE_WRITE_BUILT_SRCS
  1813. PROMETHEUS_REMOTE_WRITE_BUILT_HDRS
  1814. "src/exporting/prometheus/remote_write/remote_write.proto")
  1815. list(APPEND PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES
  1816. ${PROMETHEUS_REMOTE_WRITE_BUILT_SRCS}
  1817. ${PROMETHEUS_REMOTE_WRITE_BUILT_HDRS})
  1818. set(ENABLE_PROMETHEUS_REMOTE_WRITE True)
  1819. endif()
  1820. #
  1821. # build netdata (only Linux ATM)
  1822. #
  1823. add_executable(netdata
  1824. ${NETDATA_FILES}
  1825. "$<$<BOOL:${ENABLE_ACLK}>:${ACLK_FILES}>"
  1826. "$<$<BOOL:${ENABLE_H2O}>:${H2O_FILES}>"
  1827. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGODB_EXPORTING_FILES}>"
  1828. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${PROMETHEUS_REMOTE_WRITE_EXPORTING_FILES}>"
  1829. )
  1830. target_compile_definitions(netdata PRIVATE
  1831. "$<$<BOOL:${ENABLE_PROTOBUF}>:${PROTOBUF_CFLAGS_OTHER}>"
  1832. "$<$<BOOL:${ENABLE_ML}>:DLIB_NO_GUI_SUPPORT>"
  1833. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_CFLAGS_OTHER}>"
  1834. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_CFLAGS_OTHER}>"
  1835. )
  1836. target_include_directories(netdata PRIVATE
  1837. "$<$<BOOL:${ENABLE_PROTOBUF}>:${PROTOBUF_INCLUDE_DIRS}>"
  1838. "$<$<BOOL:${ENABLE_ACLK}>:${CMAKE_SOURCE_DIR}/src/aclk/aclk-schemas>"
  1839. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_INCLUDE_DIRS}>"
  1840. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_INCLUDE_DIRS}>"
  1841. )
  1842. target_link_libraries(netdata PRIVATE
  1843. m
  1844. libnetdata
  1845. "$<$<BOOL:${LINUX}>:rt>"
  1846. "$<$<BOOL:${ENABLE_MQTTWEBSOCKETS}>:mqttwebsockets>"
  1847. "$<$<BOOL:${ENABLE_PROTOBUF}>:${PROTOBUF_LIBRARIES}>"
  1848. "$<$<BOOL:${ENABLE_EXPORTER_MONGODB}>:${MONGOC_LIBRARIES}>"
  1849. "$<$<BOOL:${ENABLE_EXPORTER_PROMETHEUS_REMOTE_WRITE}>:${SNAPPY_LIBRARIES}>"
  1850. "$<$<BOOL:${MACOS}>:${IOKIT};${FOUNDATION}>"
  1851. "$<$<BOOL:${ENABLE_SENTRY}>:sentry>"
  1852. "$<$<BOOL:${ENABLE_WEBRTC}>:LibDataChannel::LibDataChannelStatic>"
  1853. )
  1854. #
  1855. # build systemd-cat-native
  1856. #
  1857. set(SYSTEMD_CAT_NATIVE_FILES src/libnetdata/log/systemd-cat-native.c
  1858. src/libnetdata/log/systemd-cat-native.h)
  1859. add_executable(systemd-cat-native ${SYSTEMD_CAT_NATIVE_FILES})
  1860. target_link_libraries(systemd-cat-native libnetdata)
  1861. install(TARGETS systemd-cat-native
  1862. COMPONENT systemd-cat-native
  1863. DESTINATION usr/sbin)
  1864. #
  1865. # build log2journal
  1866. #
  1867. pkg_check_modules(PCRE2 libpcre2-8)
  1868. if(PCRE2_FOUND)
  1869. set(LOG2JOURNAL_FILES
  1870. ${CONFIG_H}
  1871. src/collectors/log2journal/log2journal.h
  1872. src/collectors/log2journal/log2journal.c
  1873. src/collectors/log2journal/log2journal-help.c
  1874. src/collectors/log2journal/log2journal-yaml.c
  1875. src/collectors/log2journal/log2journal-json.c
  1876. src/collectors/log2journal/log2journal-logfmt.c
  1877. src/collectors/log2journal/log2journal-pcre2.c
  1878. src/collectors/log2journal/log2journal-params.c
  1879. src/collectors/log2journal/log2journal-inject.c
  1880. src/collectors/log2journal/log2journal-pattern.c
  1881. src/collectors/log2journal/log2journal-replace.c
  1882. src/collectors/log2journal/log2journal-rename.c
  1883. src/collectors/log2journal/log2journal-rewrite.c
  1884. )
  1885. add_executable(log2journal ${LOG2JOURNAL_FILES})
  1886. target_include_directories(log2journal BEFORE PUBLIC ${CONFIG_H_DIR} ${CMAKE_SOURCE_DIR}/src ${PCRE2_INCLUDE_DIRS})
  1887. target_compile_definitions(log2journal PUBLIC ${PCRE2_CFLAGS_OTHER})
  1888. target_link_libraries(log2journal PUBLIC "${PCRE2_LDFLAGS}")
  1889. if(ENABLE_BUNDLED_YAML)
  1890. target_include_directories(log2journal BEFORE PUBLIC "${CMAKE_SOURCE_DIR}/externaldeps/libyaml")
  1891. target_link_libraries(log2journal PUBLIC yaml)
  1892. else()
  1893. target_include_directories(log2journal BEFORE PUBLIC ${YAML_INCLUDE_DIRS})
  1894. target_compile_definitions(log2journal PUBLIC ${YAML_CFLAGS_OTHER})
  1895. target_link_libraries(log2journal PUBLIC ${YAML_LDFLAGS})
  1896. endif()
  1897. install(TARGETS log2journal
  1898. COMPONENT log2journal
  1899. DESTINATION usr/sbin)
  1900. install(DIRECTORY src/collectors/log2journal/log2journal.d
  1901. COMPONENT log2journal
  1902. DESTINATION usr/lib/netdata/conf.d)
  1903. endif()
  1904. #
  1905. # build netdatacli
  1906. #
  1907. set(NETDATACLI_FILES
  1908. src/daemon/commands.h
  1909. src/daemon/pipename.c
  1910. src/daemon/pipename.h
  1911. src/cli/cli.c
  1912. )
  1913. add_executable(netdatacli ${NETDATACLI_FILES})
  1914. target_link_libraries(netdatacli libnetdata)
  1915. install(TARGETS netdatacli
  1916. COMPONENT netdatacli
  1917. DESTINATION usr/sbin)
  1918. #
  1919. # Generate config file
  1920. #
  1921. add_definitions(-DHAVE_CONFIG_H)
  1922. set(STORAGE_WITH_MATH On)
  1923. if(NOT CMAKE_INSTALL_PREFIX STREQUAL "")
  1924. string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
  1925. endif()
  1926. set(CACHE_DIR "${CMAKE_INSTALL_PREFIX}/var/cache/netdata")
  1927. set(CONFIG_DIR "${CMAKE_INSTALL_PREFIX}/etc/netdata")
  1928. set(LIBCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")
  1929. set(LOG_DIR "${CMAKE_INSTALL_PREFIX}/var/log/netdata")
  1930. set(PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata/plugins.d")
  1931. set(VARLIB_DIR "${CMAKE_INSTALL_PREFIX}/var/lib/netdata")
  1932. # A non-default value is only used when building Debian packages (/var/lib/netdata/www)
  1933. if(NOT DEFINED WEB_DIR)
  1934. set(WEB_DIR "usr/share/netdata/web")
  1935. else()
  1936. string(REGEX REPLACE "^/" "" WEB_DIR "${WEB_DIR}")
  1937. endif()
  1938. set(WEB_DEST "${WEB_DIR}")
  1939. set(WEB_DIR "${CMAKE_INSTALL_PREFIX}/${WEB_DEST}")
  1940. set(CONFIGURE_COMMAND "dummy-configure-command")
  1941. if (NOT NETDATA_USER)
  1942. set(NETDATA_USER "netdata")
  1943. endif()
  1944. set(VERSION "${GIT_DESCRIBE_OUTPUT}")
  1945. configure_file(config.cmake.h.in config.h)
  1946. #
  1947. # install
  1948. #
  1949. install(TARGETS netdata DESTINATION usr/sbin)
  1950. install(DIRECTORY DESTINATION var/cache/netdata)
  1951. install(DIRECTORY DESTINATION var/log/netdata)
  1952. install(DIRECTORY DESTINATION var/lib/netdata/registry)
  1953. install(DIRECTORY DESTINATION var/lib/netdata/cloud.d)
  1954. install(DIRECTORY DESTINATION var/run)
  1955. install(DIRECTORY DESTINATION etc/netdata)
  1956. install(DIRECTORY DESTINATION etc/netdata/charts.d)
  1957. install(DIRECTORY DESTINATION etc/netdata/custom-plugins.d)
  1958. install(DIRECTORY DESTINATION etc/netdata/ebpf.d)
  1959. install(DIRECTORY DESTINATION etc/netdata/go.d)
  1960. install(DIRECTORY DESTINATION etc/netdata/health.d)
  1961. install(DIRECTORY DESTINATION etc/netdata/python.d)
  1962. install(DIRECTORY DESTINATION etc/netdata/ssl)
  1963. install(DIRECTORY DESTINATION etc/netdata/statsd.d)
  1964. install(DIRECTORY DESTINATION usr/lib/netdata/conf.d)
  1965. install(DIRECTORY DESTINATION usr/lib/netdata/conf.d/schema.d)
  1966. install(DIRECTORY DESTINATION usr/libexec/netdata/plugins.d)
  1967. install(DIRECTORY DESTINATION ${WEB_DEST})
  1968. set(libsysdir_POST "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/system")
  1969. set(pkglibexecdir_POST "${CMAKE_INSTALL_PREFIX}/usr/libexec/netdata")
  1970. set(localstatedir_POST "${CMAKE_INSTALL_PREFIX}/var")
  1971. set(sbindir_POST "${CMAKE_INSTALL_PREFIX}/usr/sbin")
  1972. set(configdir_POST "${CMAKE_INSTALL_PREFIX}/etc/netdata")
  1973. set(libconfigdir_POST "${CMAKE_INSTALL_PREFIX}/usr/lib/netdata/conf.d")
  1974. set(cachedir_POST "${CMAKE_INSTALL_PREFIX}/var/cache/netdata")
  1975. set(registrydir_POST "${CMAKE_INSTALL_PREFIX}/var/lib/netdata/registry")
  1976. set(varlibdir_POST "${CMAKE_INSTALL_PREFIX}/var/lib/netdata")
  1977. set(netdata_user_POST "${NETDATA_USER}")
  1978. # netdata-claim.sh
  1979. if(ENABLE_CLOUD)
  1980. set(enable_cloud_POST "yes")
  1981. else()
  1982. set(enable_cloud_POST "no")
  1983. endif()
  1984. if(ENABLE_ACLK)
  1985. set(enable_aclk_POST "yes")
  1986. else()
  1987. set(enable_aclk_POST "no")
  1988. endif()
  1989. configure_file(src/claim/netdata-claim.sh.in src/claim/netdata-claim.sh @ONLY)
  1990. install(PROGRAMS
  1991. ${CMAKE_BINARY_DIR}/src/claim/netdata-claim.sh
  1992. DESTINATION usr/sbin)
  1993. #
  1994. # We don't check ENABLE_PLUGIN_CGROUP_NETWORK because rpm builds assume
  1995. # the files exists unconditionally.
  1996. #
  1997. configure_file(src/collectors/cgroups.plugin/cgroup-network-helper.sh.in
  1998. src/collectors/cgroups.plugin/cgroup-network-helper.sh @ONLY)
  1999. install(PROGRAMS
  2000. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-network-helper.sh
  2001. COMPONENT cgroup_network_plugin
  2002. DESTINATION usr/libexec/netdata/plugins.d)
  2003. configure_file(src/collectors/cgroups.plugin/cgroup-name.sh.in
  2004. src/collectors/cgroups.plugin/cgroup-name.sh @ONLY)
  2005. install(PROGRAMS
  2006. ${CMAKE_BINARY_DIR}/src/collectors/cgroups.plugin/cgroup-name.sh
  2007. DESTINATION usr/libexec/netdata/plugins.d)
  2008. #
  2009. # statsd
  2010. #
  2011. install(FILES
  2012. src/collectors/statsd.plugin/asterisk.conf
  2013. src/collectors/statsd.plugin/example.conf
  2014. src/collectors/statsd.plugin/k6.conf
  2015. DESTINATION usr/lib/netdata/conf.d/statsd.d)
  2016. #
  2017. # exporting
  2018. #
  2019. install(FILES
  2020. src/exporting/exporting.conf
  2021. DESTINATION usr/lib/netdata/conf.d)
  2022. #
  2023. # ioping.plugin
  2024. #
  2025. install(FILES
  2026. src/collectors/ioping.plugin/ioping.conf
  2027. DESTINATION usr/lib/netdata/conf.d)
  2028. #
  2029. # streaming
  2030. #
  2031. install(FILES
  2032. src/streaming/stream.conf
  2033. DESTINATION usr/lib/netdata/conf.d)
  2034. #
  2035. # swagger
  2036. #
  2037. install(FILES
  2038. web/api/netdata-swagger.json
  2039. web/api/netdata-swagger.yaml
  2040. DESTINATION ${WEB_DEST})
  2041. #
  2042. # service files
  2043. #
  2044. configure_file(system/install-service.sh.in system/install-service.sh @ONLY)
  2045. install(PROGRAMS
  2046. ${CMAKE_BINARY_DIR}/system/install-service.sh
  2047. DESTINATION usr/libexec/netdata)
  2048. configure_file(system/cron/netdata-updater-daily.in system/cron/netdata-updater-daily @ONLY)
  2049. install(FILES
  2050. ${CMAKE_BINARY_DIR}/system/cron/netdata-updater-daily
  2051. DESTINATION usr/lib/netdata/system/cron)
  2052. configure_file(system/launchd/netdata.plist.in system/launchd/netdata.plist @ONLY)
  2053. install(FILES
  2054. ${CMAKE_BINARY_DIR}/system/launchd/netdata.plist
  2055. DESTINATION usr/lib/netdata/system/launchd)
  2056. configure_file(system/freebsd/rc.d/netdata.in system/freebsd/rc.d/netdata @ONLY)
  2057. install(PROGRAMS
  2058. ${CMAKE_BINARY_DIR}/system/freebsd/rc.d/netdata
  2059. DESTINATION usr/lib/netdata/system/freebsd/rc.d)
  2060. configure_file(system/initd/init.d/netdata.in system/initd/init.d/netdata @ONLY)
  2061. install(PROGRAMS
  2062. ${CMAKE_BINARY_DIR}/system/initd/init.d/netdata
  2063. DESTINATION usr/lib/netdata/system/initd/init.d)
  2064. configure_file(system/logrotate/netdata.in system/logrotate/netdata @ONLY)
  2065. install(FILES
  2066. ${CMAKE_BINARY_DIR}/system/logrotate/netdata
  2067. DESTINATION usr/lib/netdata/system/logrotate)
  2068. configure_file(system/lsb/init.d/netdata.in system/lsb/init.d/netdata @ONLY)
  2069. install(PROGRAMS
  2070. ${CMAKE_BINARY_DIR}/system/lsb/init.d/netdata
  2071. DESTINATION usr/lib/netdata/system/lsb/init.d)
  2072. configure_file(system/openrc/conf.d/netdata.in system/openrc/conf.d/netdata @ONLY)
  2073. install(FILES
  2074. ${CMAKE_BINARY_DIR}/system/openrc/conf.d/netdata
  2075. DESTINATION usr/lib/netdata/system/openrc/conf.d)
  2076. configure_file(system/openrc/init.d/netdata.in system/openrc/init.d/netdata @ONLY)
  2077. install(PROGRAMS
  2078. ${CMAKE_BINARY_DIR}/system/openrc/init.d/netdata
  2079. DESTINATION usr/lib/netdata/system/openrc/init.d)
  2080. configure_file(system/runit/run.in system/runit/run @ONLY)
  2081. install(PROGRAMS
  2082. ${CMAKE_BINARY_DIR}/system/runit/run
  2083. DESTINATION usr/lib/netdata/system/runit)
  2084. configure_file(system/systemd/netdata.service.in system/systemd/netdata.service @ONLY)
  2085. install(FILES
  2086. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service
  2087. DESTINATION usr/lib/netdata/system/systemd)
  2088. configure_file(system/systemd/netdata.service.v235.in system/systemd/netdata.service.v235 @ONLY)
  2089. install(FILES
  2090. ${CMAKE_BINARY_DIR}/system/systemd/netdata.service.v235
  2091. DESTINATION usr/lib/netdata/system/systemd)
  2092. configure_file(system/systemd/netdata-updater.service.in system/systemd/netdata-updater.service @ONLY)
  2093. install(FILES
  2094. ${CMAKE_BINARY_DIR}/system/systemd/netdata-updater.service
  2095. DESTINATION usr/lib/netdata/system/systemd)
  2096. install(FILES
  2097. system/systemd/netdata-updater.timer
  2098. DESTINATION usr/lib/netdata/system/systemd)
  2099. install(FILES
  2100. system/systemd/50-netdata.preset
  2101. DESTINATION usr/lib/netdata/system/systemd)
  2102. install(FILES
  2103. system/vnodes/vnodes.conf
  2104. DESTINATION usr/lib/netdata/conf.d/vnodes)
  2105. install(FILES
  2106. system/.install-type
  2107. DESTINATION etc/netdata)
  2108. install(FILES
  2109. system/netdata-updater.conf
  2110. DESTINATION etc/netdata)
  2111. install(PROGRAMS
  2112. system/edit-config
  2113. DESTINATION etc/netdata)
  2114. #
  2115. # TODO: check the following files for correct substitutions
  2116. #
  2117. configure_file(src/daemon/anonymous-statistics.sh.in src/daemon/anonymous-statistics.sh @ONLY)
  2118. install(PROGRAMS
  2119. ${CMAKE_BINARY_DIR}/src/daemon/anonymous-statistics.sh
  2120. DESTINATION usr/libexec/netdata/plugins.d)
  2121. configure_file(src/daemon/get-kubernetes-labels.sh.in src/daemon/get-kubernetes-labels.sh @ONLY)
  2122. install(PROGRAMS
  2123. ${CMAKE_BINARY_DIR}/src/daemon/get-kubernetes-labels.sh
  2124. DESTINATION usr/libexec/netdata/plugins.d)
  2125. install(PROGRAMS
  2126. src/daemon/system-info.sh
  2127. DESTINATION usr/libexec/netdata/plugins.d)
  2128. #
  2129. # health files
  2130. #
  2131. file(GLOB_RECURSE HEALTH_CONF_FILES "src/health/health.d/*.conf")
  2132. install(FILES
  2133. ${HEALTH_CONF_FILES}
  2134. DESTINATION usr/lib/netdata/conf.d/health.d)
  2135. configure_file(src/health/notifications/alarm-notify.sh.in src/health/notifications/alarm-notify.sh @ONLY)
  2136. install(PROGRAMS
  2137. ${CMAKE_BINARY_DIR}/src/health/notifications/alarm-notify.sh
  2138. DESTINATION usr/libexec/netdata/plugins.d)
  2139. install(PROGRAMS
  2140. src/health/notifications/alarm-email.sh
  2141. src/health/notifications/alarm-test.sh
  2142. DESTINATION usr/libexec/netdata/plugins.d)
  2143. install(FILES
  2144. src/health/notifications/health_alarm_notify.conf
  2145. src/health/notifications/health_email_recipients.conf
  2146. DESTINATION usr/lib/netdata/conf.d)
  2147. #
  2148. # test/ files
  2149. #
  2150. configure_file(tests/health_mgmtapi/health-cmdapi-test.sh.in tests/health_mgmtapi/health-cmdapi-test.sh @ONLY)
  2151. configure_file(tests/acls/acl.sh.in tests/acls/acl.sh @ONLY)
  2152. configure_file(tests/urls/request.sh.in tests/urls/request.sh @ONLY)
  2153. configure_file(tests/alarm_repetition/alarm.sh.in tests/alarm_repetition/alarm.sh @ONLY)
  2154. configure_file(tests/template_dimension/template_dim.sh.in tests/template_dimension/template_dim.sh @ONLY)
  2155. configure_file(tests/ebpf/ebpf_thread_function.sh.in tests/ebpf/ebpf_thread_function.sh @ONLY)
  2156. install(FILES
  2157. ${CMAKE_BINARY_DIR}/tests/health_mgmtapi/health-cmdapi-test.sh
  2158. ${CMAKE_BINARY_DIR}/tests/acls/acl.sh
  2159. ${CMAKE_BINARY_DIR}/tests/urls/request.sh
  2160. ${CMAKE_BINARY_DIR}/tests/alarm_repetition/alarm.sh
  2161. ${CMAKE_BINARY_DIR}/tests/template_dimension/template_dim.sh
  2162. ${CMAKE_BINARY_DIR}/tests/ebpf/ebpf_thread_function.sh
  2163. DESTINATION usr/libexec/netdata/plugins.d)
  2164. #
  2165. # charts.d files
  2166. #
  2167. configure_file(src/collectors/charts.d.plugin/charts.d.plugin.in src/collectors/charts.d.plugin/charts.d.plugin @ONLY)
  2168. install(PROGRAMS
  2169. ${CMAKE_BINARY_DIR}/src/collectors/charts.d.plugin/charts.d.plugin
  2170. DESTINATION usr/libexec/netdata/plugins.d)
  2171. install(FILES
  2172. src/collectors/charts.d.plugin/charts.d.dryrun-helper.sh
  2173. src/collectors/charts.d.plugin/loopsleepms.sh.inc
  2174. DESTINATION usr/libexec/netdata/plugins.d)
  2175. install(FILES
  2176. src/collectors/charts.d.plugin/charts.d.conf
  2177. DESTINATION usr/lib/netdata/conf.d)
  2178. #
  2179. # tc-qos-helper
  2180. #
  2181. configure_file(src/collectors/tc.plugin/tc-qos-helper.sh.in src/collectors/tc.plugin/tc-qos-helper.sh @ONLY)
  2182. install(PROGRAMS
  2183. ${CMAKE_BINARY_DIR}/src/collectors/tc.plugin/tc-qos-helper.sh
  2184. DESTINATION usr/libexec/netdata/plugins.d)
  2185. # scripts
  2186. install(FILES
  2187. src/collectors/charts.d.plugin/ap/ap.chart.sh
  2188. src/collectors/charts.d.plugin/apcupsd/apcupsd.chart.sh
  2189. src/collectors/charts.d.plugin/example/example.chart.sh
  2190. src/collectors/charts.d.plugin/libreswan/libreswan.chart.sh
  2191. src/collectors/charts.d.plugin/opensips/opensips.chart.sh
  2192. src/collectors/charts.d.plugin/sensors/sensors.chart.sh
  2193. DESTINATION usr/libexec/netdata/charts.d)
  2194. # confs
  2195. install(FILES
  2196. src/collectors/charts.d.plugin/ap/ap.conf
  2197. src/collectors/charts.d.plugin/apcupsd/apcupsd.conf
  2198. src/collectors/charts.d.plugin/example/example.conf
  2199. src/collectors/charts.d.plugin/libreswan/libreswan.conf
  2200. src/collectors/charts.d.plugin/opensips/opensips.conf
  2201. src/collectors/charts.d.plugin/sensors/sensors.conf
  2202. DESTINATION usr/lib/netdata/conf.d/charts.d)
  2203. install(FILES
  2204. src/collectors/systemd-journal.plugin/schema.d/systemd-journal:monitored-directories.json
  2205. src/health/schema.d/health:alert:prototype.json
  2206. DESTINATION usr/lib/netdata/conf.d/schema.d)
  2207. #
  2208. # ebpf files
  2209. #
  2210. if(ENABLE_PLUGIN_EBPF)
  2211. install(FILES
  2212. src/collectors/ebpf.plugin/ebpf.d.conf
  2213. DESTINATION usr/lib/netdata/conf.d)
  2214. install(FILES
  2215. src/collectors/ebpf.plugin/ebpf.d/cachestat.conf
  2216. src/collectors/ebpf.plugin/ebpf.d/dcstat.conf
  2217. src/collectors/ebpf.plugin/ebpf.d/disk.conf
  2218. src/collectors/ebpf.plugin/ebpf.d/ebpf_kernel_reject_list.txt
  2219. src/collectors/ebpf.plugin/ebpf.d/fd.conf
  2220. src/collectors/ebpf.plugin/ebpf.d/filesystem.conf
  2221. src/collectors/ebpf.plugin/ebpf.d/hardirq.conf
  2222. src/collectors/ebpf.plugin/ebpf.d/mdflush.conf
  2223. src/collectors/ebpf.plugin/ebpf.d/mount.conf
  2224. src/collectors/ebpf.plugin/ebpf.d/network.conf
  2225. src/collectors/ebpf.plugin/ebpf.d/oomkill.conf
  2226. src/collectors/ebpf.plugin/ebpf.d/process.conf
  2227. src/collectors/ebpf.plugin/ebpf.d/shm.conf
  2228. src/collectors/ebpf.plugin/ebpf.d/softirq.conf
  2229. src/collectors/ebpf.plugin/ebpf.d/swap.conf
  2230. src/collectors/ebpf.plugin/ebpf.d/sync.conf
  2231. src/collectors/ebpf.plugin/ebpf.d/vfs.conf
  2232. DESTINATION usr/lib/netdata/conf.d/ebpf.d)
  2233. endif()
  2234. #
  2235. # python.d files
  2236. #
  2237. configure_file(src/collectors/python.d.plugin/python.d.plugin.in src/collectors/python.d.plugin/python.d.plugin @ONLY)
  2238. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/python.d.plugin/python.d.plugin
  2239. DESTINATION usr/libexec/netdata/plugins.d)
  2240. install(DIRECTORY src/collectors/python.d.plugin/python_modules
  2241. DESTINATION usr/libexec/netdata/python.d)
  2242. install(FILES src/collectors/python.d.plugin/python.d.conf
  2243. DESTINATION usr/lib/netdata/conf.d)
  2244. # conf files
  2245. install(FILES
  2246. src/collectors/python.d.plugin/adaptec_raid/adaptec_raid.conf
  2247. src/collectors/python.d.plugin/alarms/alarms.conf
  2248. src/collectors/python.d.plugin/am2320/am2320.conf
  2249. src/collectors/python.d.plugin/anomalies/anomalies.conf
  2250. src/collectors/python.d.plugin/beanstalk/beanstalk.conf
  2251. src/collectors/python.d.plugin/bind_rndc/bind_rndc.conf
  2252. src/collectors/python.d.plugin/boinc/boinc.conf
  2253. src/collectors/python.d.plugin/ceph/ceph.conf
  2254. src/collectors/python.d.plugin/changefinder/changefinder.conf
  2255. src/collectors/python.d.plugin/dovecot/dovecot.conf
  2256. src/collectors/python.d.plugin/example/example.conf
  2257. src/collectors/python.d.plugin/exim/exim.conf
  2258. src/collectors/python.d.plugin/fail2ban/fail2ban.conf
  2259. src/collectors/python.d.plugin/gearman/gearman.conf
  2260. src/collectors/python.d.plugin/go_expvar/go_expvar.conf
  2261. src/collectors/python.d.plugin/haproxy/haproxy.conf
  2262. src/collectors/python.d.plugin/hddtemp/hddtemp.conf
  2263. src/collectors/python.d.plugin/hpssa/hpssa.conf
  2264. src/collectors/python.d.plugin/icecast/icecast.conf
  2265. src/collectors/python.d.plugin/ipfs/ipfs.conf
  2266. src/collectors/python.d.plugin/litespeed/litespeed.conf
  2267. src/collectors/python.d.plugin/megacli/megacli.conf
  2268. src/collectors/python.d.plugin/memcached/memcached.conf
  2269. src/collectors/python.d.plugin/monit/monit.conf
  2270. src/collectors/python.d.plugin/nsd/nsd.conf
  2271. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.conf
  2272. src/collectors/python.d.plugin/openldap/openldap.conf
  2273. src/collectors/python.d.plugin/oracledb/oracledb.conf
  2274. src/collectors/python.d.plugin/pandas/pandas.conf
  2275. src/collectors/python.d.plugin/postfix/postfix.conf
  2276. src/collectors/python.d.plugin/puppet/puppet.conf
  2277. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.conf
  2278. src/collectors/python.d.plugin/retroshare/retroshare.conf
  2279. src/collectors/python.d.plugin/riakkv/riakkv.conf
  2280. src/collectors/python.d.plugin/samba/samba.conf
  2281. src/collectors/python.d.plugin/sensors/sensors.conf
  2282. src/collectors/python.d.plugin/smartd_log/smartd_log.conf
  2283. src/collectors/python.d.plugin/spigotmc/spigotmc.conf
  2284. src/collectors/python.d.plugin/squid/squid.conf
  2285. src/collectors/python.d.plugin/tomcat/tomcat.conf
  2286. src/collectors/python.d.plugin/tor/tor.conf
  2287. src/collectors/python.d.plugin/traefik/traefik.conf
  2288. src/collectors/python.d.plugin/uwsgi/uwsgi.conf
  2289. src/collectors/python.d.plugin/varnish/varnish.conf
  2290. src/collectors/python.d.plugin/w1sensor/w1sensor.conf
  2291. src/collectors/python.d.plugin/zscores/zscores.conf
  2292. DESTINATION usr/lib/netdata/conf.d/python.d)
  2293. # scripts
  2294. install(FILES
  2295. src/collectors/python.d.plugin/adaptec_raid/adaptec_raid.chart.py
  2296. src/collectors/python.d.plugin/alarms/alarms.chart.py
  2297. src/collectors/python.d.plugin/am2320/am2320.chart.py
  2298. src/collectors/python.d.plugin/anomalies/anomalies.chart.py
  2299. src/collectors/python.d.plugin/beanstalk/beanstalk.chart.py
  2300. src/collectors/python.d.plugin/bind_rndc/bind_rndc.chart.py
  2301. src/collectors/python.d.plugin/boinc/boinc.chart.py
  2302. src/collectors/python.d.plugin/ceph/ceph.chart.py
  2303. src/collectors/python.d.plugin/changefinder/changefinder.chart.py
  2304. src/collectors/python.d.plugin/dovecot/dovecot.chart.py
  2305. src/collectors/python.d.plugin/example/example.chart.py
  2306. src/collectors/python.d.plugin/exim/exim.chart.py
  2307. src/collectors/python.d.plugin/fail2ban/fail2ban.chart.py
  2308. src/collectors/python.d.plugin/gearman/gearman.chart.py
  2309. src/collectors/python.d.plugin/go_expvar/go_expvar.chart.py
  2310. src/collectors/python.d.plugin/haproxy/haproxy.chart.py
  2311. src/collectors/python.d.plugin/hddtemp/hddtemp.chart.py
  2312. src/collectors/python.d.plugin/hpssa/hpssa.chart.py
  2313. src/collectors/python.d.plugin/icecast/icecast.chart.py
  2314. src/collectors/python.d.plugin/ipfs/ipfs.chart.py
  2315. src/collectors/python.d.plugin/litespeed/litespeed.chart.py
  2316. src/collectors/python.d.plugin/megacli/megacli.chart.py
  2317. src/collectors/python.d.plugin/memcached/memcached.chart.py
  2318. src/collectors/python.d.plugin/monit/monit.chart.py
  2319. src/collectors/python.d.plugin/nsd/nsd.chart.py
  2320. src/collectors/python.d.plugin/nvidia_smi/nvidia_smi.chart.py
  2321. src/collectors/python.d.plugin/openldap/openldap.chart.py
  2322. src/collectors/python.d.plugin/oracledb/oracledb.chart.py
  2323. src/collectors/python.d.plugin/pandas/pandas.chart.py
  2324. src/collectors/python.d.plugin/postfix/postfix.chart.py
  2325. src/collectors/python.d.plugin/puppet/puppet.chart.py
  2326. src/collectors/python.d.plugin/rethinkdbs/rethinkdbs.chart.py
  2327. src/collectors/python.d.plugin/retroshare/retroshare.chart.py
  2328. src/collectors/python.d.plugin/riakkv/riakkv.chart.py
  2329. src/collectors/python.d.plugin/samba/samba.chart.py
  2330. src/collectors/python.d.plugin/sensors/sensors.chart.py
  2331. src/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
  2332. src/collectors/python.d.plugin/spigotmc/spigotmc.chart.py
  2333. src/collectors/python.d.plugin/squid/squid.chart.py
  2334. src/collectors/python.d.plugin/tomcat/tomcat.chart.py
  2335. src/collectors/python.d.plugin/tor/tor.chart.py
  2336. src/collectors/python.d.plugin/traefik/traefik.chart.py
  2337. src/collectors/python.d.plugin/uwsgi/uwsgi.chart.py
  2338. src/collectors/python.d.plugin/varnish/varnish.chart.py
  2339. src/collectors/python.d.plugin/w1sensor/w1sensor.chart.py
  2340. src/collectors/python.d.plugin/zscores/zscores.chart.py
  2341. DESTINATION usr/libexec/netdata/python.d)
  2342. # FIXME: don't install this unconditionally
  2343. configure_file(src/collectors/ioping.plugin/ioping.plugin.in src/collectors/ioping.plugin/ioping.plugin @ONLY)
  2344. install(PROGRAMS ${CMAKE_BINARY_DIR}/src/collectors/ioping.plugin/ioping.plugin DESTINATION usr/libexec/netdata/plugins.d)
  2345. #
  2346. # logs management
  2347. #
  2348. if (ENABLE_PLUGIN_LOGS_MANAGEMENT)
  2349. configure_file(src/logsmanagement/stock_conf/logsmanagement.d.conf.in src/logsmanagement/stock_conf/logsmanagement.d.conf @ONLY)
  2350. install(FILES ${CMAKE_BINARY_DIR}/src/logsmanagement/stock_conf/logsmanagement.d.conf
  2351. COMPONENT logs_management_plugin
  2352. DESTINATION usr/lib/netdata/conf.d)
  2353. endif()
  2354. #
  2355. # dashboard
  2356. #
  2357. include(web/gui/v1/dashboard_v1.cmake)
  2358. include(web/gui/v2/dashboard_v2.cmake)
  2359. include(web/gui/gui.cmake)
  2360. function(cat IN_FILE OUT_FILE)
  2361. file(READ ${IN_FILE} CONTENTS)
  2362. file(APPEND ${OUT_FILE} "${CONTENTS}")
  2363. endfunction()
  2364. file(WRITE ${CMAKE_BINARY_DIR}/web/gui/dashboard.js.in "")
  2365. foreach(JS_FILE ${DASHBOARD_JS_FILES})
  2366. cat(${JS_FILE} ${CMAKE_BINARY_DIR}/dashboard.js.in)
  2367. endforeach()
  2368. configure_file(${CMAKE_BINARY_DIR}/dashboard.js.in
  2369. ${CMAKE_BINARY_DIR}/dashboard.js COPYONLY)
  2370. install(FILES
  2371. ${CMAKE_BINARY_DIR}/dashboard.js
  2372. DESTINATION ${WEB_DEST})
  2373. install(FILES
  2374. web/gui/dashboard_info_custom_example.js
  2375. web/gui/dashboard_info.js
  2376. web/gui/index.html
  2377. web/gui/main.css
  2378. web/gui/main.js
  2379. web/gui/registry-access.html
  2380. web/gui/registry-alert-redirect.html
  2381. web/gui/registry-hello.html
  2382. web/gui/switch.html
  2383. web/gui/ilove.html
  2384. DESTINATION ${WEB_DEST})
  2385. install(FILES
  2386. web/gui/old/index.html
  2387. DESTINATION ${WEB_DEST}/old)
  2388. install(FILES
  2389. web/gui/static/img/netdata-logomark.svg
  2390. DESTINATION ${WEB_DEST}/static/img)
  2391. install(FILES
  2392. web/gui/css/morris-0.5.1.css
  2393. web/gui/css/c3-0.4.18.min.css
  2394. DESTINATION ${WEB_DEST}/css)
  2395. install(FILES
  2396. web/gui/.well-known/dnt/cookies
  2397. DESTINATION ${WEB_DEST}/.well-known/dnt)
  2398. # v0 dashboard
  2399. install(FILES
  2400. web/gui/v0/index.html
  2401. DESTINATION ${WEB_DEST}/v0)