CMakeLists.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. # SPDX-License-Identifier: GPL-3.0-or-later
  2. # This file is only used for development (netdata in Clion)
  3. # It can build netdata, but you are on your own...
  4. cmake_minimum_required(VERSION 3.0.2)
  5. project(netdata C)
  6. find_package(Threads REQUIRED)
  7. find_package(PkgConfig REQUIRED)
  8. # default is "Debug"
  9. #set(CMAKE_BUILD_TYPE "Release")
  10. # set this to see the compilation commands
  11. #set(CMAKE_VERBOSE_MAKEFILE 1)
  12. # -----------------------------------------------------------------------------
  13. # Set compilation options according to build type
  14. IF("${CMAKE_BUILD_TYPE}" MATCHES "Debug")
  15. message(STATUS "building for: debugging")
  16. ## unfortunately these produce errors
  17. #include(CheckCXXCompilerFlag)
  18. #CHECK_CXX_COMPILER_FLAG("-Wformat-signedness" CXX_FORMAT_SIGNEDNESS)
  19. #CHECK_CXX_COMPILER_FLAG("-Werror=format-security" CXX_FORMAT_SECURITY)
  20. #CHECK_CXX_COMPILER_FLAG("-fstack-protector-all" CXX_STACK_PROTECTOR)
  21. set(CXX_FORMAT_SIGNEDNESS "-Wformat-signedness")
  22. set(CXX_FORMAT_SECURITY "-Werror=format-security")
  23. set(CXX_STACK_PROTECTOR "-fstack-protector-all")
  24. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O1 -ggdb -Wall -Wextra -DNETDATA_INTERNAL_CHECKS=1 -DNETDATA_VERIFY_LOCKS=1 ${CXX_FORMAT_SIGNEDNESS} ${CXX_FORMAT_SECURITY} ${CXX_STACK_PROTECTOR}")
  25. ELSE()
  26. message(STATUS "building for: release")
  27. cmake_policy(SET CMP0069 "NEW")
  28. include(CheckIPOSupported)
  29. check_ipo_supported(RESULT ipo_supported OUTPUT error)
  30. IF(${ipo_supported})
  31. message(STATUS "link time optimization: supported")
  32. set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
  33. ELSE()
  34. message(STATUS "link time optimization: not supported")
  35. ENDIF()
  36. ENDIF()
  37. # -----------------------------------------------------------------------------
  38. # O/S Detection
  39. # these are defined in common.h too
  40. SET(LINUX False)
  41. SET(FREEBSD False)
  42. SET(MACOS False)
  43. # Detect the operating system
  44. IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  45. SET(TARGET_OS_NAME "macos")
  46. SET(TARGET_OS 3)
  47. SET(MACOS True)
  48. ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  49. SET(TARGET_OS_NAME "freebsd")
  50. SET(TARGET_OS 2)
  51. SET(FREEBSD True)
  52. ELSE()
  53. SET(TARGET_OS_NAME "linux")
  54. SET(TARGET_OS 1)
  55. SET(LINUX True)
  56. ENDIF()
  57. # show the operating system on the console
  58. message(STATUS "operating system: ${TARGET_OS_NAME} (TARGET_OS=${TARGET_OS})")
  59. # -----------------------------------------------------------------------------
  60. # Detect libuuid
  61. pkg_check_modules(UUID REQUIRED uuid)
  62. set(NETDATA_COMMON_CFLAGS ${NETDATA_COMMON_CFLAGS} ${UUID_CFLAGS_OTHER})
  63. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} ${UUID_LIBRARIES})
  64. set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
  65. # -----------------------------------------------------------------------------
  66. # Detect libz
  67. pkg_check_modules(ZLIB REQUIRED zlib)
  68. set(NETDATA_COMMON_CFLAGS ${NETDATA_COMMON_CFLAGS} ${ZLIB_CFLAGS_OTHER})
  69. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} ${ZLIB_LIBRARIES})
  70. set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
  71. # -----------------------------------------------------------------------------
  72. # Detect libcap
  73. IF(LINUX)
  74. pkg_check_modules(CAP QUIET libcap)
  75. # later we use:
  76. # ${CAP_LIBRARIES}
  77. # ${CAP_CFLAGS_OTHER}
  78. # ${CAP_INCLUDE_DIRS}
  79. ENDIF(LINUX)
  80. # -----------------------------------------------------------------------------
  81. # Detect libipmimonitoring
  82. IF(LINUX)
  83. pkg_check_modules(IPMI libipmimonitoring)
  84. # later we use:
  85. # ${IPMI_LIBRARIES}
  86. # ${IPMI_CFLAGS_OTHER}
  87. # ${IPMI_INCLUDE_DIRS}
  88. ENDIF(LINUX)
  89. # -----------------------------------------------------------------------------
  90. # Detect libmnl
  91. IF(LINUX)
  92. pkg_check_modules(MNL libmnl)
  93. # later we use:
  94. # ${MNL_LIBRARIES}
  95. # ${MNL_CFLAGS_OTHER}
  96. # ${MNL_INCLUDE_DIRS}
  97. ENDIF(LINUX)
  98. # -----------------------------------------------------------------------------
  99. # Detect libmnl
  100. pkg_check_modules(NFACCT libnetfilter_acct)
  101. # later we use:
  102. # ${NFACCT_LIBRARIES}
  103. # ${NFACCT_CFLAGS_OTHER}
  104. # ${NFACCT_INCLUDE_DIRS}
  105. # -----------------------------------------------------------------------------
  106. # Detect MacOS IOKit/Foundation framework
  107. IF(MACOS)
  108. find_library(IOKIT IOKit)
  109. find_library(FOUNDATION Foundation)
  110. # later we use:
  111. # ${FOUNDATION}
  112. # ${IOKIT}
  113. ENDIF(MACOS)
  114. # -----------------------------------------------------------------------------
  115. # netdata files
  116. set(LIBNETDATA_FILES
  117. libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  118. libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  119. libnetdata/config/appconfig.c
  120. libnetdata/config/appconfig.h
  121. libnetdata/avl/avl.c
  122. libnetdata/avl/avl.h
  123. libnetdata/buffer/buffer.c
  124. libnetdata/buffer/buffer.h
  125. libnetdata/clocks/clocks.c
  126. libnetdata/clocks/clocks.h
  127. libnetdata/dictionary/dictionary.c
  128. libnetdata/dictionary/dictionary.h
  129. libnetdata/eval/eval.c
  130. libnetdata/eval/eval.h
  131. libnetdata/inlined.h
  132. libnetdata/libnetdata.c
  133. libnetdata/libnetdata.h
  134. libnetdata/locks/locks.c
  135. libnetdata/locks/locks.h
  136. libnetdata/log/log.c
  137. libnetdata/log/log.h
  138. libnetdata/os.c
  139. libnetdata/os.h
  140. libnetdata/popen/popen.c
  141. libnetdata/popen/popen.h
  142. libnetdata/procfile/procfile.c
  143. libnetdata/procfile/procfile.h
  144. libnetdata/simple_pattern/simple_pattern.c
  145. libnetdata/simple_pattern/simple_pattern.h
  146. libnetdata/socket/socket.c
  147. libnetdata/socket/socket.h
  148. libnetdata/statistical/statistical.c
  149. libnetdata/statistical/statistical.h
  150. libnetdata/storage_number/storage_number.c
  151. libnetdata/storage_number/storage_number.h
  152. libnetdata/threads/threads.c
  153. libnetdata/threads/threads.h
  154. libnetdata/url/url.c
  155. libnetdata/url/url.h
  156. )
  157. add_library(libnetdata OBJECT ${LIBNETDATA_FILES})
  158. set(APPS_PLUGIN_FILES
  159. collectors/apps.plugin/apps_plugin.c
  160. )
  161. set(CHECKS_PLUGIN_FILES
  162. collectors/checks.plugin/plugin_checks.c
  163. collectors/checks.plugin/plugin_checks.h
  164. )
  165. set(FREEBSD_PLUGIN_FILES
  166. collectors/freebsd.plugin/plugin_freebsd.c
  167. collectors/freebsd.plugin/plugin_freebsd.h
  168. collectors/freebsd.plugin/freebsd_sysctl.c
  169. collectors/freebsd.plugin/freebsd_getmntinfo.c
  170. collectors/freebsd.plugin/freebsd_getifaddrs.c
  171. collectors/freebsd.plugin/freebsd_devstat.c
  172. collectors/freebsd.plugin/freebsd_kstat_zfs.c
  173. collectors/freebsd.plugin/freebsd_ipfw.c
  174. collectors/proc.plugin/zfs_common.c
  175. collectors/proc.plugin/zfs_common.h
  176. )
  177. set(HEALTH_PLUGIN_FILES
  178. health/health.c
  179. health/health.h
  180. health/health_config.c
  181. health/health_json.c
  182. health/health_log.c
  183. )
  184. set(IDLEJITTER_PLUGIN_FILES
  185. collectors/idlejitter.plugin/plugin_idlejitter.c
  186. collectors/idlejitter.plugin/plugin_idlejitter.h
  187. )
  188. set(CGROUPS_PLUGIN_FILES
  189. collectors/cgroups.plugin/sys_fs_cgroup.c
  190. collectors/cgroups.plugin/sys_fs_cgroup.h
  191. )
  192. set(CGROUP_NETWORK_FILES
  193. collectors/cgroups.plugin/cgroup-network.c
  194. )
  195. set(DISKSPACE_PLUGIN_FILES
  196. collectors/diskspace.plugin/plugin_diskspace.h
  197. collectors/diskspace.plugin/plugin_diskspace.c
  198. )
  199. set(FREEIPMI_PLUGIN_FILES
  200. collectors/freeipmi.plugin/freeipmi_plugin.c
  201. )
  202. set(NFACCT_PLUGIN_FILES
  203. collectors/nfacct.plugin/plugin_nfacct.c
  204. collectors/nfacct.plugin/plugin_nfacct.h
  205. )
  206. set(PROC_PLUGIN_FILES
  207. collectors/proc.plugin/ipc.c
  208. collectors/proc.plugin/plugin_proc.c
  209. collectors/proc.plugin/plugin_proc.h
  210. collectors/proc.plugin/proc_diskstats.c
  211. collectors/proc.plugin/proc_mdstat.c
  212. collectors/proc.plugin/proc_interrupts.c
  213. collectors/proc.plugin/proc_softirqs.c
  214. collectors/proc.plugin/proc_loadavg.c
  215. collectors/proc.plugin/proc_meminfo.c
  216. collectors/proc.plugin/proc_net_dev.c
  217. collectors/proc.plugin/proc_net_ip_vs_stats.c
  218. collectors/proc.plugin/proc_net_netstat.c
  219. collectors/proc.plugin/proc_net_rpc_nfs.c
  220. collectors/proc.plugin/proc_net_rpc_nfsd.c
  221. collectors/proc.plugin/proc_net_snmp.c
  222. collectors/proc.plugin/proc_net_snmp6.c
  223. collectors/proc.plugin/proc_net_sctp_snmp.c
  224. collectors/proc.plugin/proc_net_sockstat.c
  225. collectors/proc.plugin/proc_net_sockstat6.c
  226. collectors/proc.plugin/proc_net_softnet_stat.c
  227. collectors/proc.plugin/proc_net_stat_conntrack.c
  228. collectors/proc.plugin/proc_net_stat_synproxy.c
  229. collectors/proc.plugin/proc_self_mountinfo.c
  230. collectors/proc.plugin/proc_self_mountinfo.h
  231. collectors/proc.plugin/zfs_common.c
  232. collectors/proc.plugin/zfs_common.h
  233. collectors/proc.plugin/proc_spl_kstat_zfs.c
  234. collectors/proc.plugin/proc_stat.c
  235. collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  236. collectors/proc.plugin/proc_vmstat.c
  237. collectors/proc.plugin/proc_uptime.c
  238. collectors/proc.plugin/sys_kernel_mm_ksm.c
  239. collectors/proc.plugin/sys_devices_system_edac_mc.c
  240. collectors/proc.plugin/sys_devices_system_node.c
  241. collectors/proc.plugin/sys_fs_btrfs.c
  242. )
  243. set(TC_PLUGIN_FILES
  244. collectors/tc.plugin/plugin_tc.c
  245. collectors/tc.plugin/plugin_tc.h
  246. )
  247. set(MACOS_PLUGIN_FILES
  248. collectors/macos.plugin/plugin_macos.c
  249. collectors/macos.plugin/plugin_macos.h
  250. collectors/macos.plugin/macos_sysctl.c
  251. collectors/macos.plugin/macos_mach_smi.c
  252. collectors/macos.plugin/macos_fw.c
  253. )
  254. set(PLUGINSD_PLUGIN_FILES
  255. collectors/plugins.d/plugins_d.c
  256. collectors/plugins.d/plugins_d.h
  257. )
  258. set(REGISTRY_PLUGIN_FILES
  259. registry/registry.c
  260. registry/registry.h
  261. registry/registry_db.c
  262. registry/registry_init.c
  263. registry/registry_internals.c
  264. registry/registry_internals.h
  265. registry/registry_log.c
  266. registry/registry_machine.c
  267. registry/registry_machine.h
  268. registry/registry_person.c
  269. registry/registry_person.h
  270. registry/registry_url.c
  271. registry/registry_url.h
  272. )
  273. set(STATSD_PLUGIN_FILES
  274. collectors/statsd.plugin/statsd.c
  275. collectors/statsd.plugin/statsd.h
  276. )
  277. set(RRD_PLUGIN_FILES
  278. database/rrdcalc.c
  279. database/rrdcalc.h
  280. database/rrdcalctemplate.c
  281. database/rrdcalctemplate.h
  282. database/rrddim.c
  283. database/rrddimvar.c
  284. database/rrddimvar.h
  285. database/rrdfamily.c
  286. database/rrdhost.c
  287. database/rrd.c
  288. database/rrd.h
  289. database/rrdset.c
  290. database/rrdsetvar.c
  291. database/rrdsetvar.h
  292. database/rrdvar.c
  293. database/rrdvar.h
  294. )
  295. set(WEB_PLUGIN_FILES
  296. web/server/web_client.c
  297. web/server/web_client.h
  298. web/server/web_server.c
  299. web/server/web_server.h
  300. web/server/single/single-threaded.c
  301. web/server/single/single-threaded.h
  302. web/server/multi/multi-threaded.c
  303. web/server/multi/multi-threaded.h
  304. web/server/static/static-threaded.c
  305. web/server/static/static-threaded.h
  306. web/server/web_client_cache.c
  307. web/server/web_client_cache.h
  308. )
  309. set(API_PLUGIN_FILES
  310. web/api/web_api_v1.c
  311. web/api/web_api_v1.h
  312. web/api/badges/web_buffer_svg.c
  313. web/api/badges/web_buffer_svg.h
  314. web/api/exporters/allmetrics.c
  315. web/api/exporters/allmetrics.h
  316. web/api/exporters/shell/allmetrics_shell.c
  317. web/api/exporters/shell/allmetrics_shell.h
  318. web/api/queries/rrdr.c
  319. web/api/queries/rrdr.h
  320. web/api/queries/query.c
  321. web/api/queries/query.h
  322. web/api/queries/average/average.c
  323. web/api/queries/average/average.h
  324. web/api/queries/incremental_sum/incremental_sum.c
  325. web/api/queries/incremental_sum/incremental_sum.h
  326. web/api/queries/max/max.c
  327. web/api/queries/max/max.h
  328. web/api/queries/min/min.c
  329. web/api/queries/min/min.h
  330. web/api/queries/sum/sum.c
  331. web/api/queries/sum/sum.h
  332. web/api/queries/median/median.c
  333. web/api/queries/median/median.h
  334. web/api/queries/stddev/stddev.c
  335. web/api/queries/stddev/stddev.h
  336. web/api/queries/ses/ses.c
  337. web/api/queries/ses/ses.h
  338. web/api/queries/des/des.c
  339. web/api/queries/des/des.h
  340. web/api/formatters/rrd2json.c
  341. web/api/formatters/rrd2json.h
  342. web/api/formatters/csv/csv.c
  343. web/api/formatters/csv/csv.h
  344. web/api/formatters/json/json.c
  345. web/api/formatters/json/json.h
  346. web/api/formatters/ssv/ssv.c
  347. web/api/formatters/ssv/ssv.h
  348. web/api/formatters/value/value.c
  349. web/api/formatters/value/value.h
  350. web/api/formatters/json_wrapper.c
  351. web/api/formatters/json_wrapper.h
  352. web/api/formatters/charts2json.c
  353. web/api/formatters/charts2json.h
  354. web/api/formatters/rrdset2json.c
  355. web/api/formatters/rrdset2json.h
  356. )
  357. set(STREAMING_PLUGIN_FILES
  358. streaming/rrdpush.c
  359. streaming/rrdpush.h
  360. )
  361. set(BACKENDS_PLUGIN_FILES
  362. backends/backends.c
  363. backends/backends.h
  364. backends/graphite/graphite.c
  365. backends/graphite/graphite.h
  366. backends/json/json.c
  367. backends/json/json.h
  368. backends/opentsdb/opentsdb.c
  369. backends/opentsdb/opentsdb.h
  370. backends/prometheus/backend_prometheus.c
  371. backends/prometheus/backend_prometheus.h
  372. )
  373. set(DAEMON_FILES
  374. daemon/common.c
  375. daemon/common.h
  376. daemon/daemon.c
  377. daemon/daemon.h
  378. daemon/global_statistics.c
  379. daemon/global_statistics.h
  380. daemon/main.c
  381. daemon/main.h
  382. daemon/signals.c
  383. daemon/signals.h
  384. daemon/unit_test.c
  385. daemon/unit_test.h
  386. )
  387. set(NETDATA_FILES
  388. collectors/all.h
  389. ${DAEMON_FILES}
  390. ${API_PLUGIN_FILES}
  391. ${BACKENDS_PLUGIN_FILES}
  392. ${CHECKS_PLUGIN_FILES}
  393. ${HEALTH_PLUGIN_FILES}
  394. ${IDLEJITTER_PLUGIN_FILES}
  395. ${PLUGINSD_PLUGIN_FILES}
  396. ${RRD_PLUGIN_FILES}
  397. ${REGISTRY_PLUGIN_FILES}
  398. ${STATSD_PLUGIN_FILES}
  399. ${STREAMING_PLUGIN_FILES}
  400. ${WEB_PLUGIN_FILES}
  401. )
  402. IF(LINUX AND MNL_LIBRARIES AND NFACCT_LIBRARIES)
  403. message(STATUS "nfacct.plugin: enabled (will work only if netdata runs as root)")
  404. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DINTERNAL_PLUGIN_NFACCT=1")
  405. ELSE()
  406. message(STATUS "nfacct.plugin: disabled (requires libmnl and libnetfilter_acct)")
  407. ENDIF()
  408. include_directories(AFTER .)
  409. add_definitions(
  410. -DHAVE_CONFIG_H
  411. -DTARGET_OS=${TARGET_OS}
  412. -DCACHE_DIR="/var/cache/netdata"
  413. -DCONFIG_DIR="/etc/netdata"
  414. -DLIBCONFIG_DIR="/usr/lib/netdata/conf.d"
  415. -DLOG_DIR="/var/log/netdata"
  416. -DPLUGINS_DIR="/usr/libexec/netdata"
  417. -DWEB_DIR="/usr/share/netdata"
  418. -DVARLIB_DIR="/var/lib/netdata"
  419. )
  420. # -----------------------------------------------------------------------------
  421. # netdata
  422. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT})
  423. IF(LINUX)
  424. add_executable(netdata config.h ${NETDATA_FILES}
  425. ${CGROUPS_PLUGIN_FILES}
  426. ${DISKSPACE_PLUGIN_FILES}
  427. ${NFACCT_PLUGIN_FILES}
  428. ${PROC_PLUGIN_FILES}
  429. ${TC_PLUGIN_FILES}
  430. )
  431. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES}
  432. ${MNL_LIBRARIES}
  433. ${NFACCT_LIBRARIES}
  434. )
  435. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS}
  436. ${MNL_INCLUDE_DIRS}
  437. ${NFACCT_INCLUDE_DIRS}
  438. )
  439. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS}
  440. ${MNL_CFLAGS_OTHER}
  441. ${NFACCT_CFLAGS_OTHER}
  442. )
  443. SET(ENABLE_PLUGIN_CGROUP_NETWORK True)
  444. SET(ENABLE_PLUGIN_APPS True)
  445. ELSEIF(FREEBSD)
  446. add_executable(netdata config.h ${NETDATA_FILES} ${FREEBSD_PLUGIN_FILES})
  447. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
  448. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  449. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  450. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  451. SET(ENABLE_PLUGIN_APPS True)
  452. ELSEIF(MACOS)
  453. add_executable(netdata config.h ${NETDATA_FILES} ${MACOS_PLUGIN_FILES})
  454. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES} ${IOKIT} ${FOUNDATION})
  455. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  456. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  457. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  458. SET(ENABLE_PLUGIN_APPS False)
  459. ENDIF()
  460. IF(IPMI_LIBRARIES)
  461. SET(ENABLE_PLUGIN_FREEIPMI True)
  462. ELSE()
  463. SET(ENABLE_PLUGIN_FREEIPMI False)
  464. ENDIF()
  465. # -----------------------------------------------------------------------------
  466. # apps.plugin
  467. IF(ENABLE_PLUGIN_APPS)
  468. message(STATUS "apps.plugin: enabled")
  469. add_executable(apps.plugin config.h ${APPS_PLUGIN_FILES})
  470. target_link_libraries (apps.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${CAP_LIBRARIES})
  471. target_include_directories(apps.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${CAP_INCLUDE_DIRS})
  472. target_compile_options(apps.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${CAP_CFLAGS_OTHER})
  473. ELSE()
  474. message(STATUS "apps.plugin: disabled")
  475. ENDIF()
  476. # -----------------------------------------------------------------------------
  477. # freeipmi.plugin
  478. IF(ENABLE_PLUGIN_FREEIPMI)
  479. message(STATUS "freeipmi.plugin: enabled")
  480. add_executable(freeipmi.plugin config.h ${FREEIPMI_PLUGIN_FILES})
  481. target_link_libraries (freeipmi.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${IPMI_LIBRARIES})
  482. target_include_directories(apps.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${IPMI_INCLUDE_DIRS})
  483. target_compile_options(apps.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${IPMI_CFLAGS_OTHER})
  484. ELSE()
  485. message(STATUS "freeipmi.plugin: disabled (depends on libipmimonitoring)")
  486. ENDIF()
  487. # -----------------------------------------------------------------------------
  488. # cgroup-network
  489. IF(ENABLE_PLUGIN_CGROUP_NETWORK)
  490. message(STATUS "cgroup-network: enabled")
  491. add_executable(cgroup-network config.h ${CGROUP_NETWORK_FILES})
  492. target_link_libraries (cgroup-network libnetdata ${NETDATA_COMMON_LIBRARIES})
  493. target_include_directories(apps.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  494. target_compile_options(apps.plugin PUBLIC ${NETDATA_COMMON_CFLAGS})
  495. ELSE()
  496. message(STATUS "cgroup-network: disabled (requires Linux)")
  497. ENDIF()