CMakeLists.txt 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  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(CXX_FLAGS_DEBUG "-O0")
  25. 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} ${CXX_FLAGS_DEBUG}")
  26. ELSE()
  27. message(STATUS "building for: release")
  28. cmake_policy(SET CMP0069 "NEW")
  29. include(CheckIPOSupported)
  30. check_ipo_supported(RESULT ipo_supported OUTPUT error)
  31. IF(${ipo_supported})
  32. message(STATUS "link time optimization: supported")
  33. set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
  34. ELSE()
  35. message(STATUS "link time optimization: not supported")
  36. ENDIF()
  37. ENDIF()
  38. # -----------------------------------------------------------------------------
  39. # O/S Detection
  40. # these are defined in common.h too
  41. SET(LINUX False)
  42. SET(FREEBSD False)
  43. SET(MACOS False)
  44. # Detect the operating system
  45. IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  46. SET(TARGET_OS_NAME "macos")
  47. SET(TARGET_OS 3)
  48. SET(MACOS True)
  49. ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
  50. SET(TARGET_OS_NAME "freebsd")
  51. SET(TARGET_OS 2)
  52. SET(FREEBSD True)
  53. ELSE()
  54. SET(TARGET_OS_NAME "linux")
  55. SET(TARGET_OS 1)
  56. SET(LINUX True)
  57. ENDIF()
  58. # show the operating system on the console
  59. message(STATUS "operating system: ${TARGET_OS_NAME} (TARGET_OS=${TARGET_OS})")
  60. # -----------------------------------------------------------------------------
  61. # Detect libuuid
  62. pkg_check_modules(UUID REQUIRED uuid)
  63. set(NETDATA_COMMON_CFLAGS ${NETDATA_COMMON_CFLAGS} ${UUID_CFLAGS_OTHER})
  64. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} ${UUID_LIBRARIES})
  65. set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
  66. # -----------------------------------------------------------------------------
  67. # Detect libz
  68. pkg_check_modules(ZLIB REQUIRED zlib)
  69. set(NETDATA_COMMON_CFLAGS ${NETDATA_COMMON_CFLAGS} ${ZLIB_CFLAGS_OTHER})
  70. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} ${ZLIB_LIBRARIES})
  71. set(NETDATA_COMMON_INCLUDE_DIRS ${NETDATA_COMMON_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS})
  72. # -----------------------------------------------------------------------------
  73. # Detect libcap
  74. IF(LINUX)
  75. pkg_check_modules(CAP QUIET libcap)
  76. # later we use:
  77. # ${CAP_LIBRARIES}
  78. # ${CAP_CFLAGS_OTHER}
  79. # ${CAP_INCLUDE_DIRS}
  80. ENDIF(LINUX)
  81. # -----------------------------------------------------------------------------
  82. # Detect libipmimonitoring
  83. IF(LINUX)
  84. pkg_check_modules(IPMI libipmimonitoring)
  85. # later we use:
  86. # ${IPMI_LIBRARIES}
  87. # ${IPMI_CFLAGS_OTHER}
  88. # ${IPMI_INCLUDE_DIRS}
  89. ENDIF(LINUX)
  90. # -----------------------------------------------------------------------------
  91. # Detect libmnl
  92. IF(LINUX)
  93. pkg_check_modules(MNL libmnl)
  94. # later we use:
  95. # ${MNL_LIBRARIES}
  96. # ${MNL_CFLAGS_OTHER}
  97. # ${MNL_INCLUDE_DIRS}
  98. ENDIF(LINUX)
  99. # -----------------------------------------------------------------------------
  100. # Detect libmnl
  101. pkg_check_modules(NFACCT libnetfilter_acct)
  102. # later we use:
  103. # ${NFACCT_LIBRARIES}
  104. # ${NFACCT_CFLAGS_OTHER}
  105. # ${NFACCT_INCLUDE_DIRS}
  106. # -----------------------------------------------------------------------------
  107. # Detect MacOS IOKit/Foundation framework
  108. IF(MACOS)
  109. find_library(IOKIT IOKit)
  110. find_library(FOUNDATION Foundation)
  111. # later we use:
  112. # ${FOUNDATION}
  113. # ${IOKIT}
  114. ENDIF(MACOS)
  115. # -----------------------------------------------------------------------------
  116. # netdata files
  117. set(LIBNETDATA_FILES
  118. libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  119. libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  120. libnetdata/config/appconfig.c
  121. libnetdata/config/appconfig.h
  122. libnetdata/avl/avl.c
  123. libnetdata/avl/avl.h
  124. libnetdata/buffer/buffer.c
  125. libnetdata/buffer/buffer.h
  126. libnetdata/clocks/clocks.c
  127. libnetdata/clocks/clocks.h
  128. libnetdata/dictionary/dictionary.c
  129. libnetdata/dictionary/dictionary.h
  130. libnetdata/eval/eval.c
  131. libnetdata/eval/eval.h
  132. libnetdata/inlined.h
  133. libnetdata/libnetdata.c
  134. libnetdata/libnetdata.h
  135. libnetdata/locks/locks.c
  136. libnetdata/locks/locks.h
  137. libnetdata/log/log.c
  138. libnetdata/log/log.h
  139. libnetdata/os.c
  140. libnetdata/os.h
  141. libnetdata/popen/popen.c
  142. libnetdata/popen/popen.h
  143. libnetdata/procfile/procfile.c
  144. libnetdata/procfile/procfile.h
  145. libnetdata/simple_pattern/simple_pattern.c
  146. libnetdata/simple_pattern/simple_pattern.h
  147. libnetdata/socket/socket.c
  148. libnetdata/socket/socket.h
  149. libnetdata/statistical/statistical.c
  150. libnetdata/statistical/statistical.h
  151. libnetdata/storage_number/storage_number.c
  152. libnetdata/storage_number/storage_number.h
  153. libnetdata/threads/threads.c
  154. libnetdata/threads/threads.h
  155. libnetdata/url/url.c
  156. libnetdata/url/url.h
  157. )
  158. add_library(libnetdata OBJECT ${LIBNETDATA_FILES})
  159. set(APPS_PLUGIN_FILES
  160. collectors/apps.plugin/apps_plugin.c
  161. )
  162. set(CHECKS_PLUGIN_FILES
  163. collectors/checks.plugin/plugin_checks.c
  164. collectors/checks.plugin/plugin_checks.h
  165. )
  166. set(FREEBSD_PLUGIN_FILES
  167. collectors/freebsd.plugin/plugin_freebsd.c
  168. collectors/freebsd.plugin/plugin_freebsd.h
  169. collectors/freebsd.plugin/freebsd_sysctl.c
  170. collectors/freebsd.plugin/freebsd_getmntinfo.c
  171. collectors/freebsd.plugin/freebsd_getifaddrs.c
  172. collectors/freebsd.plugin/freebsd_devstat.c
  173. collectors/freebsd.plugin/freebsd_kstat_zfs.c
  174. collectors/freebsd.plugin/freebsd_ipfw.c
  175. collectors/proc.plugin/zfs_common.c
  176. collectors/proc.plugin/zfs_common.h
  177. )
  178. set(HEALTH_PLUGIN_FILES
  179. health/health.c
  180. health/health.h
  181. health/health_config.c
  182. health/health_json.c
  183. health/health_log.c)
  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. )
  205. set(PROC_PLUGIN_FILES
  206. collectors/proc.plugin/ipc.c
  207. collectors/proc.plugin/plugin_proc.c
  208. collectors/proc.plugin/plugin_proc.h
  209. collectors/proc.plugin/proc_diskstats.c
  210. collectors/proc.plugin/proc_mdstat.c
  211. collectors/proc.plugin/proc_interrupts.c
  212. collectors/proc.plugin/proc_softirqs.c
  213. collectors/proc.plugin/proc_loadavg.c
  214. collectors/proc.plugin/proc_meminfo.c
  215. collectors/proc.plugin/proc_net_dev.c
  216. collectors/proc.plugin/proc_net_ip_vs_stats.c
  217. collectors/proc.plugin/proc_net_netstat.c
  218. collectors/proc.plugin/proc_net_rpc_nfs.c
  219. collectors/proc.plugin/proc_net_rpc_nfsd.c
  220. collectors/proc.plugin/proc_net_snmp.c
  221. collectors/proc.plugin/proc_net_snmp6.c
  222. collectors/proc.plugin/proc_net_sctp_snmp.c
  223. collectors/proc.plugin/proc_net_sockstat.c
  224. collectors/proc.plugin/proc_net_sockstat6.c
  225. collectors/proc.plugin/proc_net_softnet_stat.c
  226. collectors/proc.plugin/proc_net_stat_conntrack.c
  227. collectors/proc.plugin/proc_net_stat_synproxy.c
  228. collectors/proc.plugin/proc_self_mountinfo.c
  229. collectors/proc.plugin/proc_self_mountinfo.h
  230. collectors/proc.plugin/zfs_common.c
  231. collectors/proc.plugin/zfs_common.h
  232. collectors/proc.plugin/proc_spl_kstat_zfs.c
  233. collectors/proc.plugin/proc_stat.c
  234. collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  235. collectors/proc.plugin/proc_vmstat.c
  236. collectors/proc.plugin/proc_uptime.c
  237. collectors/proc.plugin/sys_kernel_mm_ksm.c
  238. collectors/proc.plugin/sys_devices_system_edac_mc.c
  239. collectors/proc.plugin/sys_devices_system_node.c
  240. collectors/proc.plugin/sys_fs_btrfs.c
  241. collectors/proc.plugin/sys_class_power_supply.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/static/static-threaded.c
  301. web/server/static/static-threaded.h
  302. web/server/web_client_cache.c
  303. web/server/web_client_cache.h
  304. )
  305. set(API_PLUGIN_FILES
  306. web/api/web_api_v1.c
  307. web/api/web_api_v1.h
  308. web/api/badges/web_buffer_svg.c
  309. web/api/badges/web_buffer_svg.h
  310. web/api/exporters/allmetrics.c
  311. web/api/exporters/allmetrics.h
  312. web/api/exporters/shell/allmetrics_shell.c
  313. web/api/exporters/shell/allmetrics_shell.h
  314. web/api/queries/rrdr.c
  315. web/api/queries/rrdr.h
  316. web/api/queries/query.c
  317. web/api/queries/query.h
  318. web/api/queries/average/average.c
  319. web/api/queries/average/average.h
  320. web/api/queries/incremental_sum/incremental_sum.c
  321. web/api/queries/incremental_sum/incremental_sum.h
  322. web/api/queries/max/max.c
  323. web/api/queries/max/max.h
  324. web/api/queries/min/min.c
  325. web/api/queries/min/min.h
  326. web/api/queries/sum/sum.c
  327. web/api/queries/sum/sum.h
  328. web/api/queries/median/median.c
  329. web/api/queries/median/median.h
  330. web/api/queries/stddev/stddev.c
  331. web/api/queries/stddev/stddev.h
  332. web/api/queries/ses/ses.c
  333. web/api/queries/ses/ses.h
  334. web/api/queries/des/des.c
  335. web/api/queries/des/des.h
  336. web/api/formatters/rrd2json.c
  337. web/api/formatters/rrd2json.h
  338. web/api/formatters/csv/csv.c
  339. web/api/formatters/csv/csv.h
  340. web/api/formatters/json/json.c
  341. web/api/formatters/json/json.h
  342. web/api/formatters/ssv/ssv.c
  343. web/api/formatters/ssv/ssv.h
  344. web/api/formatters/value/value.c
  345. web/api/formatters/value/value.h
  346. web/api/formatters/json_wrapper.c
  347. web/api/formatters/json_wrapper.h
  348. web/api/formatters/charts2json.c
  349. web/api/formatters/charts2json.h
  350. web/api/formatters/rrdset2json.c
  351. web/api/formatters/rrdset2json.h
  352. web/api/health/health_cmdapi.c
  353. )
  354. set(STREAMING_PLUGIN_FILES
  355. streaming/rrdpush.c
  356. streaming/rrdpush.h
  357. )
  358. set(BACKENDS_PLUGIN_FILES
  359. backends/backends.c
  360. backends/backends.h
  361. backends/graphite/graphite.c
  362. backends/graphite/graphite.h
  363. backends/json/json.c
  364. backends/json/json.h
  365. backends/opentsdb/opentsdb.c
  366. backends/opentsdb/opentsdb.h
  367. backends/prometheus/backend_prometheus.c
  368. backends/prometheus/backend_prometheus.h
  369. )
  370. set(DAEMON_FILES
  371. daemon/common.c
  372. daemon/common.h
  373. daemon/daemon.c
  374. daemon/daemon.h
  375. daemon/global_statistics.c
  376. daemon/global_statistics.h
  377. daemon/main.c
  378. daemon/main.h
  379. daemon/signals.c
  380. daemon/signals.h
  381. daemon/unit_test.c
  382. daemon/unit_test.h
  383. )
  384. set(NETDATA_FILES
  385. collectors/all.h
  386. ${DAEMON_FILES}
  387. ${API_PLUGIN_FILES}
  388. ${BACKENDS_PLUGIN_FILES}
  389. ${CHECKS_PLUGIN_FILES}
  390. ${HEALTH_PLUGIN_FILES}
  391. ${IDLEJITTER_PLUGIN_FILES}
  392. ${PLUGINSD_PLUGIN_FILES}
  393. ${RRD_PLUGIN_FILES}
  394. ${REGISTRY_PLUGIN_FILES}
  395. ${STATSD_PLUGIN_FILES}
  396. ${STREAMING_PLUGIN_FILES}
  397. ${WEB_PLUGIN_FILES}
  398. )
  399. include_directories(AFTER .)
  400. add_definitions(
  401. -DHAVE_CONFIG_H
  402. -DTARGET_OS=${TARGET_OS}
  403. -DCACHE_DIR="/var/cache/netdata"
  404. -DCONFIG_DIR="/etc/netdata"
  405. -DLIBCONFIG_DIR="/usr/lib/netdata/conf.d"
  406. -DLOG_DIR="/var/log/netdata"
  407. -DPLUGINS_DIR="/usr/libexec/netdata/plugins.d"
  408. -DWEB_DIR="/usr/share/netdata/web"
  409. -DVARLIB_DIR="/var/lib/netdata"
  410. )
  411. # -----------------------------------------------------------------------------
  412. # netdata
  413. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT})
  414. IF(LINUX)
  415. add_executable(netdata config.h ${NETDATA_FILES}
  416. ${CGROUPS_PLUGIN_FILES}
  417. ${DISKSPACE_PLUGIN_FILES}
  418. ${PROC_PLUGIN_FILES}
  419. ${TC_PLUGIN_FILES}
  420. )
  421. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
  422. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  423. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  424. SET(ENABLE_PLUGIN_CGROUP_NETWORK True)
  425. SET(ENABLE_PLUGIN_APPS True)
  426. ELSEIF(FREEBSD)
  427. add_executable(netdata config.h ${NETDATA_FILES} ${FREEBSD_PLUGIN_FILES})
  428. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
  429. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  430. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  431. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  432. SET(ENABLE_PLUGIN_APPS True)
  433. ELSEIF(MACOS)
  434. add_executable(netdata config.h ${NETDATA_FILES} ${MACOS_PLUGIN_FILES})
  435. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES} ${IOKIT} ${FOUNDATION})
  436. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  437. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  438. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  439. SET(ENABLE_PLUGIN_APPS False)
  440. ENDIF()
  441. IF(IPMI_LIBRARIES)
  442. SET(ENABLE_PLUGIN_FREEIPMI True)
  443. ELSE()
  444. SET(ENABLE_PLUGIN_FREEIPMI False)
  445. ENDIF()
  446. IF(LINUX AND MNL_LIBRARIES AND NFACCT_LIBRARIES)
  447. SET(ENABLE_PLUGIN_NFACCT True)
  448. ELSE()
  449. SET(ENABLE_PLUGIN_NFACCT False)
  450. ENDIF()
  451. # -----------------------------------------------------------------------------
  452. # apps.plugin
  453. IF(ENABLE_PLUGIN_APPS)
  454. message(STATUS "apps.plugin: enabled")
  455. add_executable(apps.plugin config.h ${APPS_PLUGIN_FILES})
  456. target_link_libraries (apps.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${CAP_LIBRARIES})
  457. target_include_directories(apps.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${CAP_INCLUDE_DIRS})
  458. target_compile_options(apps.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${CAP_CFLAGS_OTHER})
  459. ELSE()
  460. message(STATUS "apps.plugin: disabled")
  461. ENDIF()
  462. # -----------------------------------------------------------------------------
  463. # freeipmi.plugin
  464. IF(ENABLE_PLUGIN_FREEIPMI)
  465. message(STATUS "freeipmi.plugin: enabled")
  466. add_executable(freeipmi.plugin config.h ${FREEIPMI_PLUGIN_FILES})
  467. target_link_libraries (freeipmi.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${IPMI_LIBRARIES})
  468. target_include_directories(freeipmi.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${IPMI_INCLUDE_DIRS})
  469. target_compile_options(freeipmi.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${IPMI_CFLAGS_OTHER})
  470. ELSE()
  471. message(STATUS "freeipmi.plugin: disabled (depends on libipmimonitoring)")
  472. ENDIF()
  473. # -----------------------------------------------------------------------------
  474. # nfacct.plugin
  475. IF(ENABLE_PLUGIN_NFACCT)
  476. message(STATUS "nfacct.plugin: enabled")
  477. add_executable(nfacct.plugin config.h ${NFACCT_PLUGIN_FILES})
  478. target_link_libraries (nfacct.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  479. target_include_directories(nfacct.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  480. target_compile_options(nfacct.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  481. ELSE()
  482. message(STATUS "nfacct.plugin: disabled (requires libmnl and libnetfilter_acct)")
  483. ENDIF()
  484. # -----------------------------------------------------------------------------
  485. # cgroup-network
  486. IF(ENABLE_PLUGIN_CGROUP_NETWORK)
  487. message(STATUS "cgroup-network: enabled")
  488. add_executable(cgroup-network config.h ${CGROUP_NETWORK_FILES})
  489. target_link_libraries (cgroup-network libnetdata ${NETDATA_COMMON_LIBRARIES})
  490. target_include_directories(cgroup-network PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  491. target_compile_options(cgroup-network PUBLIC ${NETDATA_COMMON_CFLAGS})
  492. ELSE()
  493. message(STATUS "cgroup-network: disabled (requires Linux)")
  494. ENDIF()