CMakeLists.txt 101 KB

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