CMakeLists.txt 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  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 libxenstat
  108. pkg_check_modules(XENSTAT libxenstat)
  109. # later we use:
  110. # ${XENSTAT_LIBRARIES}
  111. # ${XENSTAT_CFLAGS_OTHER}
  112. # ${XENSTAT_INCLUDE_DIRS}
  113. # -----------------------------------------------------------------------------
  114. # Detect MacOS IOKit/Foundation framework
  115. IF(MACOS)
  116. find_library(IOKIT IOKit)
  117. find_library(FOUNDATION Foundation)
  118. # later we use:
  119. # ${FOUNDATION}
  120. # ${IOKIT}
  121. ENDIF(MACOS)
  122. # -----------------------------------------------------------------------------
  123. # netdata files
  124. set(LIBNETDATA_FILES
  125. libnetdata/adaptive_resortable_list/adaptive_resortable_list.c
  126. libnetdata/adaptive_resortable_list/adaptive_resortable_list.h
  127. libnetdata/config/appconfig.c
  128. libnetdata/config/appconfig.h
  129. libnetdata/avl/avl.c
  130. libnetdata/avl/avl.h
  131. libnetdata/buffer/buffer.c
  132. libnetdata/buffer/buffer.h
  133. libnetdata/clocks/clocks.c
  134. libnetdata/clocks/clocks.h
  135. libnetdata/dictionary/dictionary.c
  136. libnetdata/dictionary/dictionary.h
  137. libnetdata/eval/eval.c
  138. libnetdata/eval/eval.h
  139. libnetdata/inlined.h
  140. libnetdata/libnetdata.c
  141. libnetdata/libnetdata.h
  142. libnetdata/locks/locks.c
  143. libnetdata/locks/locks.h
  144. libnetdata/log/log.c
  145. libnetdata/log/log.h
  146. libnetdata/os.c
  147. libnetdata/os.h
  148. libnetdata/popen/popen.c
  149. libnetdata/popen/popen.h
  150. libnetdata/procfile/procfile.c
  151. libnetdata/procfile/procfile.h
  152. libnetdata/simple_pattern/simple_pattern.c
  153. libnetdata/simple_pattern/simple_pattern.h
  154. libnetdata/socket/socket.c
  155. libnetdata/socket/socket.h
  156. libnetdata/statistical/statistical.c
  157. libnetdata/statistical/statistical.h
  158. libnetdata/storage_number/storage_number.c
  159. libnetdata/storage_number/storage_number.h
  160. libnetdata/threads/threads.c
  161. libnetdata/threads/threads.h
  162. libnetdata/url/url.c
  163. libnetdata/url/url.h
  164. )
  165. add_library(libnetdata OBJECT ${LIBNETDATA_FILES})
  166. set(APPS_PLUGIN_FILES
  167. collectors/apps.plugin/apps_plugin.c
  168. )
  169. set(CHECKS_PLUGIN_FILES
  170. collectors/checks.plugin/plugin_checks.c
  171. collectors/checks.plugin/plugin_checks.h
  172. )
  173. set(FREEBSD_PLUGIN_FILES
  174. collectors/freebsd.plugin/plugin_freebsd.c
  175. collectors/freebsd.plugin/plugin_freebsd.h
  176. collectors/freebsd.plugin/freebsd_sysctl.c
  177. collectors/freebsd.plugin/freebsd_getmntinfo.c
  178. collectors/freebsd.plugin/freebsd_getifaddrs.c
  179. collectors/freebsd.plugin/freebsd_devstat.c
  180. collectors/freebsd.plugin/freebsd_kstat_zfs.c
  181. collectors/freebsd.plugin/freebsd_ipfw.c
  182. collectors/proc.plugin/zfs_common.c
  183. collectors/proc.plugin/zfs_common.h
  184. )
  185. set(HEALTH_PLUGIN_FILES
  186. health/health.c
  187. health/health.h
  188. health/health_config.c
  189. health/health_json.c
  190. health/health_log.c)
  191. set(IDLEJITTER_PLUGIN_FILES
  192. collectors/idlejitter.plugin/plugin_idlejitter.c
  193. collectors/idlejitter.plugin/plugin_idlejitter.h
  194. )
  195. set(CGROUPS_PLUGIN_FILES
  196. collectors/cgroups.plugin/sys_fs_cgroup.c
  197. collectors/cgroups.plugin/sys_fs_cgroup.h
  198. )
  199. set(CGROUP_NETWORK_FILES
  200. collectors/cgroups.plugin/cgroup-network.c
  201. )
  202. set(DISKSPACE_PLUGIN_FILES
  203. collectors/diskspace.plugin/plugin_diskspace.h
  204. collectors/diskspace.plugin/plugin_diskspace.c
  205. )
  206. set(FREEIPMI_PLUGIN_FILES
  207. collectors/freeipmi.plugin/freeipmi_plugin.c
  208. )
  209. set(NFACCT_PLUGIN_FILES
  210. collectors/nfacct.plugin/plugin_nfacct.c
  211. )
  212. set(XENSTAT_PLUGIN_FILES
  213. collectors/xenstat.plugin/xenstat_plugin.c
  214. )
  215. set(PROC_PLUGIN_FILES
  216. collectors/proc.plugin/ipc.c
  217. collectors/proc.plugin/plugin_proc.c
  218. collectors/proc.plugin/plugin_proc.h
  219. collectors/proc.plugin/proc_diskstats.c
  220. collectors/proc.plugin/proc_mdstat.c
  221. collectors/proc.plugin/proc_interrupts.c
  222. collectors/proc.plugin/proc_softirqs.c
  223. collectors/proc.plugin/proc_loadavg.c
  224. collectors/proc.plugin/proc_meminfo.c
  225. collectors/proc.plugin/proc_net_dev.c
  226. collectors/proc.plugin/proc_net_ip_vs_stats.c
  227. collectors/proc.plugin/proc_net_netstat.c
  228. collectors/proc.plugin/proc_net_rpc_nfs.c
  229. collectors/proc.plugin/proc_net_rpc_nfsd.c
  230. collectors/proc.plugin/proc_net_snmp.c
  231. collectors/proc.plugin/proc_net_snmp6.c
  232. collectors/proc.plugin/proc_net_sctp_snmp.c
  233. collectors/proc.plugin/proc_net_sockstat.c
  234. collectors/proc.plugin/proc_net_sockstat6.c
  235. collectors/proc.plugin/proc_net_softnet_stat.c
  236. collectors/proc.plugin/proc_net_stat_conntrack.c
  237. collectors/proc.plugin/proc_net_stat_synproxy.c
  238. collectors/proc.plugin/proc_self_mountinfo.c
  239. collectors/proc.plugin/proc_self_mountinfo.h
  240. collectors/proc.plugin/zfs_common.c
  241. collectors/proc.plugin/zfs_common.h
  242. collectors/proc.plugin/proc_spl_kstat_zfs.c
  243. collectors/proc.plugin/proc_stat.c
  244. collectors/proc.plugin/proc_sys_kernel_random_entropy_avail.c
  245. collectors/proc.plugin/proc_vmstat.c
  246. collectors/proc.plugin/proc_uptime.c
  247. collectors/proc.plugin/sys_kernel_mm_ksm.c
  248. collectors/proc.plugin/sys_devices_system_edac_mc.c
  249. collectors/proc.plugin/sys_devices_system_node.c
  250. collectors/proc.plugin/sys_fs_btrfs.c
  251. collectors/proc.plugin/sys_class_power_supply.c
  252. )
  253. set(TC_PLUGIN_FILES
  254. collectors/tc.plugin/plugin_tc.c
  255. collectors/tc.plugin/plugin_tc.h
  256. )
  257. set(MACOS_PLUGIN_FILES
  258. collectors/macos.plugin/plugin_macos.c
  259. collectors/macos.plugin/plugin_macos.h
  260. collectors/macos.plugin/macos_sysctl.c
  261. collectors/macos.plugin/macos_mach_smi.c
  262. collectors/macos.plugin/macos_fw.c
  263. )
  264. set(PLUGINSD_PLUGIN_FILES
  265. collectors/plugins.d/plugins_d.c
  266. collectors/plugins.d/plugins_d.h
  267. )
  268. set(REGISTRY_PLUGIN_FILES
  269. registry/registry.c
  270. registry/registry.h
  271. registry/registry_db.c
  272. registry/registry_init.c
  273. registry/registry_internals.c
  274. registry/registry_internals.h
  275. registry/registry_log.c
  276. registry/registry_machine.c
  277. registry/registry_machine.h
  278. registry/registry_person.c
  279. registry/registry_person.h
  280. registry/registry_url.c
  281. registry/registry_url.h
  282. )
  283. set(STATSD_PLUGIN_FILES
  284. collectors/statsd.plugin/statsd.c
  285. collectors/statsd.plugin/statsd.h
  286. )
  287. set(RRD_PLUGIN_FILES
  288. database/rrdcalc.c
  289. database/rrdcalc.h
  290. database/rrdcalctemplate.c
  291. database/rrdcalctemplate.h
  292. database/rrddim.c
  293. database/rrddimvar.c
  294. database/rrddimvar.h
  295. database/rrdfamily.c
  296. database/rrdhost.c
  297. database/rrd.c
  298. database/rrd.h
  299. database/rrdset.c
  300. database/rrdsetvar.c
  301. database/rrdsetvar.h
  302. database/rrdvar.c
  303. database/rrdvar.h
  304. )
  305. set(WEB_PLUGIN_FILES
  306. web/server/web_client.c
  307. web/server/web_client.h
  308. web/server/web_server.c
  309. web/server/web_server.h
  310. web/server/static/static-threaded.c
  311. web/server/static/static-threaded.h
  312. web/server/web_client_cache.c
  313. web/server/web_client_cache.h
  314. )
  315. set(API_PLUGIN_FILES
  316. web/api/web_api_v1.c
  317. web/api/web_api_v1.h
  318. web/api/badges/web_buffer_svg.c
  319. web/api/badges/web_buffer_svg.h
  320. web/api/exporters/allmetrics.c
  321. web/api/exporters/allmetrics.h
  322. web/api/exporters/shell/allmetrics_shell.c
  323. web/api/exporters/shell/allmetrics_shell.h
  324. web/api/queries/rrdr.c
  325. web/api/queries/rrdr.h
  326. web/api/queries/query.c
  327. web/api/queries/query.h
  328. web/api/queries/average/average.c
  329. web/api/queries/average/average.h
  330. web/api/queries/incremental_sum/incremental_sum.c
  331. web/api/queries/incremental_sum/incremental_sum.h
  332. web/api/queries/max/max.c
  333. web/api/queries/max/max.h
  334. web/api/queries/min/min.c
  335. web/api/queries/min/min.h
  336. web/api/queries/sum/sum.c
  337. web/api/queries/sum/sum.h
  338. web/api/queries/median/median.c
  339. web/api/queries/median/median.h
  340. web/api/queries/stddev/stddev.c
  341. web/api/queries/stddev/stddev.h
  342. web/api/queries/ses/ses.c
  343. web/api/queries/ses/ses.h
  344. web/api/queries/des/des.c
  345. web/api/queries/des/des.h
  346. web/api/formatters/rrd2json.c
  347. web/api/formatters/rrd2json.h
  348. web/api/formatters/csv/csv.c
  349. web/api/formatters/csv/csv.h
  350. web/api/formatters/json/json.c
  351. web/api/formatters/json/json.h
  352. web/api/formatters/ssv/ssv.c
  353. web/api/formatters/ssv/ssv.h
  354. web/api/formatters/value/value.c
  355. web/api/formatters/value/value.h
  356. web/api/formatters/json_wrapper.c
  357. web/api/formatters/json_wrapper.h
  358. web/api/formatters/charts2json.c
  359. web/api/formatters/charts2json.h
  360. web/api/formatters/rrdset2json.c
  361. web/api/formatters/rrdset2json.h
  362. web/api/health/health_cmdapi.c
  363. )
  364. set(STREAMING_PLUGIN_FILES
  365. streaming/rrdpush.c
  366. streaming/rrdpush.h
  367. )
  368. set(BACKENDS_PLUGIN_FILES
  369. backends/backends.c
  370. backends/backends.h
  371. backends/graphite/graphite.c
  372. backends/graphite/graphite.h
  373. backends/json/json.c
  374. backends/json/json.h
  375. backends/opentsdb/opentsdb.c
  376. backends/opentsdb/opentsdb.h
  377. backends/prometheus/backend_prometheus.c
  378. backends/prometheus/backend_prometheus.h
  379. )
  380. set(DAEMON_FILES
  381. daemon/common.c
  382. daemon/common.h
  383. daemon/daemon.c
  384. daemon/daemon.h
  385. daemon/global_statistics.c
  386. daemon/global_statistics.h
  387. daemon/main.c
  388. daemon/main.h
  389. daemon/signals.c
  390. daemon/signals.h
  391. daemon/unit_test.c
  392. daemon/unit_test.h
  393. )
  394. set(NETDATA_FILES
  395. collectors/all.h
  396. ${DAEMON_FILES}
  397. ${API_PLUGIN_FILES}
  398. ${BACKENDS_PLUGIN_FILES}
  399. ${CHECKS_PLUGIN_FILES}
  400. ${HEALTH_PLUGIN_FILES}
  401. ${IDLEJITTER_PLUGIN_FILES}
  402. ${PLUGINSD_PLUGIN_FILES}
  403. ${RRD_PLUGIN_FILES}
  404. ${REGISTRY_PLUGIN_FILES}
  405. ${STATSD_PLUGIN_FILES}
  406. ${STREAMING_PLUGIN_FILES}
  407. ${WEB_PLUGIN_FILES}
  408. )
  409. include_directories(AFTER .)
  410. add_definitions(
  411. -DHAVE_CONFIG_H
  412. -DTARGET_OS=${TARGET_OS}
  413. -DCACHE_DIR="/var/cache/netdata"
  414. -DCONFIG_DIR="/etc/netdata"
  415. -DLIBCONFIG_DIR="/usr/lib/netdata/conf.d"
  416. -DLOG_DIR="/var/log/netdata"
  417. -DPLUGINS_DIR="/usr/libexec/netdata/plugins.d"
  418. -DWEB_DIR="/usr/share/netdata/web"
  419. -DVARLIB_DIR="/var/lib/netdata"
  420. )
  421. # -----------------------------------------------------------------------------
  422. # netdata
  423. set(NETDATA_COMMON_LIBRARIES ${NETDATA_COMMON_LIBRARIES} m ${CMAKE_THREAD_LIBS_INIT})
  424. IF(LINUX)
  425. add_executable(netdata config.h ${NETDATA_FILES}
  426. ${CGROUPS_PLUGIN_FILES}
  427. ${DISKSPACE_PLUGIN_FILES}
  428. ${PROC_PLUGIN_FILES}
  429. ${TC_PLUGIN_FILES}
  430. )
  431. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
  432. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  433. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  434. SET(ENABLE_PLUGIN_CGROUP_NETWORK True)
  435. SET(ENABLE_PLUGIN_APPS True)
  436. ELSEIF(FREEBSD)
  437. add_executable(netdata config.h ${NETDATA_FILES} ${FREEBSD_PLUGIN_FILES})
  438. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES})
  439. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  440. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  441. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  442. SET(ENABLE_PLUGIN_APPS True)
  443. ELSEIF(MACOS)
  444. add_executable(netdata config.h ${NETDATA_FILES} ${MACOS_PLUGIN_FILES})
  445. target_link_libraries (netdata libnetdata ${NETDATA_COMMON_LIBRARIES} ${IOKIT} ${FOUNDATION})
  446. target_include_directories(netdata PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  447. target_compile_options(netdata PUBLIC ${NETDATA_COMMON_CFLAGS})
  448. SET(ENABLE_PLUGIN_CGROUP_NETWORK False)
  449. SET(ENABLE_PLUGIN_APPS False)
  450. ENDIF()
  451. IF(IPMI_LIBRARIES)
  452. SET(ENABLE_PLUGIN_FREEIPMI True)
  453. ELSE()
  454. SET(ENABLE_PLUGIN_FREEIPMI False)
  455. ENDIF()
  456. IF(LINUX AND MNL_LIBRARIES AND NFACCT_LIBRARIES)
  457. SET(ENABLE_PLUGIN_NFACCT True)
  458. ELSE()
  459. SET(ENABLE_PLUGIN_NFACCT False)
  460. ENDIF()
  461. IF(XENSTAT_LIBRARIES)
  462. SET(ENABLE_PLUGIN_XENSTAT True)
  463. ELSE()
  464. SET(ENABLE_PLUGIN_XENSTAT False)
  465. ENDIF()
  466. # -----------------------------------------------------------------------------
  467. # apps.plugin
  468. IF(ENABLE_PLUGIN_APPS)
  469. message(STATUS "apps.plugin: enabled")
  470. add_executable(apps.plugin config.h ${APPS_PLUGIN_FILES})
  471. target_link_libraries (apps.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${CAP_LIBRARIES})
  472. target_include_directories(apps.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${CAP_INCLUDE_DIRS})
  473. target_compile_options(apps.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${CAP_CFLAGS_OTHER})
  474. ELSE()
  475. message(STATUS "apps.plugin: disabled")
  476. ENDIF()
  477. # -----------------------------------------------------------------------------
  478. # freeipmi.plugin
  479. IF(ENABLE_PLUGIN_FREEIPMI)
  480. message(STATUS "freeipmi.plugin: enabled")
  481. add_executable(freeipmi.plugin config.h ${FREEIPMI_PLUGIN_FILES})
  482. target_link_libraries (freeipmi.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${IPMI_LIBRARIES})
  483. target_include_directories(freeipmi.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${IPMI_INCLUDE_DIRS})
  484. target_compile_options(freeipmi.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${IPMI_CFLAGS_OTHER})
  485. ELSE()
  486. message(STATUS "freeipmi.plugin: disabled (depends on libipmimonitoring)")
  487. ENDIF()
  488. # -----------------------------------------------------------------------------
  489. # nfacct.plugin
  490. IF(ENABLE_PLUGIN_NFACCT)
  491. message(STATUS "nfacct.plugin: enabled")
  492. add_executable(nfacct.plugin config.h ${NFACCT_PLUGIN_FILES})
  493. target_link_libraries (nfacct.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${MNL_LIBRARIES} ${NFACCT_LIBRARIES})
  494. target_include_directories(nfacct.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${MNL_INCLUDE_DIRS} ${NFACCT_INCLUDE_DIRS})
  495. target_compile_options(nfacct.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${MNL_CFLAGS_OTHER} ${NFACCT_CFLAGS_OTHER})
  496. ELSE()
  497. message(STATUS "nfacct.plugin: disabled (requires libmnl and libnetfilter_acct)")
  498. ENDIF()
  499. # -----------------------------------------------------------------------------
  500. # xenstat.plugin
  501. IF(ENABLE_PLUGIN_XENSTAT)
  502. message(STATUS "xenstat.plugin: enabled")
  503. add_executable(xenstat.plugin config.h ${XENSTAT_PLUGIN_FILES})
  504. target_link_libraries (xenstat.plugin libnetdata ${NETDATA_COMMON_LIBRARIES} ${XENSTAT_LIBRARIES})
  505. target_include_directories(xenstat.plugin PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS} ${XENSTAT_INCLUDE_DIRS})
  506. target_compile_options(xenstat.plugin PUBLIC ${NETDATA_COMMON_CFLAGS} ${XENSTAT_CFLAGS_OTHER})
  507. ELSE()
  508. message(STATUS "xenstat.plugin: disabled (requires libxenstat)")
  509. ENDIF()
  510. # -----------------------------------------------------------------------------
  511. # cgroup-network
  512. IF(ENABLE_PLUGIN_CGROUP_NETWORK)
  513. message(STATUS "cgroup-network: enabled")
  514. add_executable(cgroup-network config.h ${CGROUP_NETWORK_FILES})
  515. target_link_libraries (cgroup-network libnetdata ${NETDATA_COMMON_LIBRARIES})
  516. target_include_directories(cgroup-network PUBLIC ${NETDATA_COMMON_INCLUDE_DIRS})
  517. target_compile_options(cgroup-network PUBLIC ${NETDATA_COMMON_CFLAGS})
  518. ELSE()
  519. message(STATUS "cgroup-network: disabled (requires Linux)")
  520. ENDIF()