CMakeLists.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. # SPDX-License-Identifier: GPL-3.0+
  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.3)
  5. project(netdata C)
  6. find_package (Threads)
  7. set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat-signedness -Werror=format-security -DNETDATA_INTERNAL_CHECKS=1 -fstack-protector-all")
  8. set(NETDATA_FREEBSD_FILES
  9. src/plugin_freebsd.c
  10. src/plugin_freebsd.h
  11. src/freebsd_sysctl.c
  12. src/freebsd_getmntinfo.c
  13. src/freebsd_getifaddrs.c
  14. src/freebsd_devstat.c
  15. src/zfs_common.c
  16. src/zfs_common.h
  17. src/freebsd_kstat_zfs.c
  18. src/freebsd_ipfw.c
  19. )
  20. set(NETDATA_MACOS_FILES
  21. src/plugin_macos.c
  22. src/plugin_macos.h
  23. src/macos_sysctl.c
  24. src/macos_mach_smi.c
  25. src/macos_fw.c
  26. )
  27. set(NETDATA_LINUX_FILES
  28. src/ipc.c
  29. src/ipc.h
  30. src/plugin_proc.c
  31. src/plugin_proc.h
  32. src/plugin_proc_diskspace.c
  33. src/plugin_proc_diskspace.h
  34. src/proc_diskstats.c
  35. src/proc_interrupts.c
  36. src/proc_softirqs.c
  37. src/proc_loadavg.c
  38. src/proc_meminfo.c
  39. src/proc_net_dev.c
  40. src/proc_net_ip_vs_stats.c
  41. src/proc_net_netstat.c
  42. src/proc_net_rpc_nfs.c
  43. src/proc_net_rpc_nfsd.c
  44. src/proc_net_snmp.c
  45. src/proc_net_snmp6.c
  46. src/proc_net_sctp_snmp.c
  47. src/proc_net_sockstat.c
  48. src/proc_net_sockstat6.c
  49. src/proc_net_softnet_stat.c
  50. src/proc_net_stat_conntrack.c
  51. src/proc_net_stat_synproxy.c
  52. src/zfs_common.c
  53. src/zfs_common.h
  54. src/proc_spl_kstat_zfs.c
  55. src/proc_stat.c
  56. src/proc_sys_kernel_random_entropy_avail.c
  57. src/proc_vmstat.c
  58. src/proc_uptime.c
  59. src/sys_kernel_mm_ksm.c
  60. src/sys_fs_cgroup.c
  61. src/sys_fs_btrfs.c
  62. src/threads.c src/threads.h)
  63. set(NETDATA_COMMON_FILES
  64. src/adaptive_resortable_list.c
  65. src/adaptive_resortable_list.h
  66. src/appconfig.c
  67. src/appconfig.h
  68. src/avl.c
  69. src/avl.h
  70. src/backend_prometheus.c
  71. src/backend_prometheus.h
  72. src/backends.c
  73. src/backends.h
  74. src/clocks.c
  75. src/clocks.h
  76. src/common.c
  77. src/common.h
  78. src/daemon.c
  79. src/daemon.h
  80. src/dictionary.c
  81. src/dictionary.h
  82. src/eval.c
  83. src/eval.h
  84. src/global_statistics.c
  85. src/global_statistics.h
  86. src/health.c
  87. src/health.h
  88. src/health_config.c
  89. src/health_json.c
  90. src/health_log.c
  91. src/inlined.h
  92. src/locks.c
  93. src/locks.h
  94. src/log.c
  95. src/log.h
  96. src/main.c
  97. src/main.h
  98. src/plugin_checks.c
  99. src/plugin_checks.h
  100. src/plugin_idlejitter.c
  101. src/plugin_idlejitter.h
  102. src/plugin_nfacct.c
  103. src/plugin_nfacct.h
  104. src/plugin_tc.c
  105. src/plugin_tc.h
  106. src/plugins_d.c
  107. src/plugins_d.h
  108. src/popen.c
  109. src/popen.h
  110. src/proc_self_mountinfo.c
  111. src/proc_self_mountinfo.h
  112. src/procfile.c
  113. src/procfile.h
  114. src/registry.c
  115. src/registry.h
  116. src/registry_db.c
  117. src/registry_init.c
  118. src/registry_internals.c
  119. src/registry_internals.h
  120. src/registry_log.c
  121. src/registry_machine.c
  122. src/registry_machine.h
  123. src/registry_person.c
  124. src/registry_person.h
  125. src/registry_url.c
  126. src/registry_url.h
  127. src/rrd.c
  128. src/rrd.h
  129. src/rrd2json.c
  130. src/rrd2json.h
  131. src/rrd2json_api_old.c
  132. src/rrd2json_api_old.h
  133. src/rrdcalc.c
  134. src/rrdcalctemplate.c
  135. src/rrddim.c
  136. src/rrddimvar.c
  137. src/rrdfamily.c
  138. src/rrdhost.c
  139. src/rrdpush.c
  140. src/rrdpush.h
  141. src/rrdset.c
  142. src/rrdsetvar.c
  143. src/rrdvar.c
  144. src/signals.c
  145. src/signals.h
  146. src/simple_pattern.c
  147. src/simple_pattern.h
  148. src/socket.c
  149. src/socket.h
  150. src/statistical.c
  151. src/statistical.h
  152. src/statsd.c
  153. src/statsd.h
  154. src/storage_number.c
  155. src/storage_number.h
  156. src/sys_devices_system_edac_mc.c
  157. src/sys_devices_system_node.c
  158. src/unit_test.c
  159. src/unit_test.h
  160. src/url.c
  161. src/url.h
  162. src/web_api_old.c
  163. src/web_api_old.h
  164. src/web_api_v1.c
  165. src/web_api_v1.h
  166. src/web_buffer.c
  167. src/web_buffer.h
  168. src/web_buffer_svg.c
  169. src/web_buffer_svg.h
  170. src/web_client.c
  171. src/web_client.h
  172. src/web_server.c
  173. src/web_server.h
  174. config.h
  175. )
  176. set(APPS_PLUGIN_SOURCE_FILES
  177. src/appconfig.c
  178. src/appconfig.h
  179. src/apps_plugin.c
  180. src/avl.c
  181. src/avl.h
  182. src/common.c
  183. src/common.h
  184. src/clocks.c
  185. src/clocks.h
  186. src/inlined.h
  187. src/locks.c
  188. src/locks.h
  189. src/log.c
  190. src/log.h
  191. src/procfile.c
  192. src/procfile.h
  193. src/web_buffer.c
  194. src/web_buffer.h
  195. config.h
  196. )
  197. set(FREEIPMI_PLUGIN_SOURCE_FILES
  198. src/freeipmi_plugin.c
  199. src/common.c
  200. src/common.h
  201. src/clocks.c
  202. src/clocks.h
  203. src/inlined.h
  204. src/locks.c
  205. src/locks.h
  206. src/log.c
  207. src/log.h
  208. src/procfile.c
  209. src/procfile.h
  210. config.h
  211. )
  212. set(CGROUP_NETWORK_SOURCE_FILES
  213. src/cgroup-network.c
  214. src/common.c
  215. src/common.h
  216. src/clocks.c
  217. src/clocks.h
  218. src/inlined.h
  219. src/locks.c
  220. src/locks.h
  221. src/log.c
  222. src/log.h
  223. src/procfile.c
  224. src/procfile.h
  225. src/web_buffer.c
  226. src/web_buffer.h
  227. config.h
  228. )
  229. include_directories(AFTER .)
  230. add_definitions(-DHAVE_CONFIG_H -DCACHE_DIR="/var/cache/netdata" -DCONFIG_DIR="/etc/netdata" -DLOG_DIR="/var/log/netdata" -DPLUGINS_DIR="/usr/libexec/netdata" -DWEB_DIR="/usr/share/netdata" -DVARLIB_DIR="/var/lib/netdata")
  231. add_executable(netdata ${NETDATA_COMMON_FILES} ${NETDATA_LINUX_FILES})
  232. target_link_libraries (netdata m z uuid mnl netfilter_acct ${CMAKE_THREAD_LIBS_INIT})
  233. add_executable(netdata_freebsd ${NETDATA_COMMON_FILES} ${NETDATA_FREEBSD_FILES})
  234. target_link_libraries (netdata_freebsd m z uuid ${CMAKE_THREAD_LIBS_INIT})
  235. add_executable(netdata_macos ${NETDATA_COMMON_FILES} ${NETDATA_MACOS_FILES})
  236. target_link_libraries (netdata_macos m z uuid ${CMAKE_THREAD_LIBS_INIT})
  237. add_executable(apps.plugin ${APPS_PLUGIN_SOURCE_FILES} src/inlined.h)
  238. target_link_libraries (apps.plugin m ${CMAKE_THREAD_LIBS_INIT})
  239. add_executable(freeipmi.plugin ${FREEIPMI_PLUGIN_SOURCE_FILES})
  240. target_link_libraries (freeipmi.plugin ipmimonitoring)
  241. add_executable(cgroup-network ${CGROUP_NETWORK_SOURCE_FILES})
  242. target_link_libraries (cgroup-network m ${CMAKE_THREAD_LIBS_INIT})