@cryptotaxi247 / netdata-1 / commits / 06dfb108d

cmake is now operational

Costa Tsaousis committed Jun 18, 2016 at 13:10 UTC 06dfb108d389f8dc02a96cc6595f6e124b6da105
1 file changed +97 -83
CMakeLists.txt
+97 -83
@@ -1,99 +1,113 @@
1
2 -# This file is just a hack to make netdata
3 -# open in Clion
4 -# It cannot build netdata
2 +# This file is only used for development (open netdata in Clion)
3 +# It can build netdata, but you are on your own...
4
5 cmake_minimum_required(VERSION 3.3)
7 -project(netdata)
6 +project(netdata C)
7
9 -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
8 +find_package (Threads)
9 +
10 +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat-signedness")
11
12 set(NETDATA_SOURCE_FILES
12 - src/appconfig.c
13 - src/appconfig.h
14 - src/avl.c
15 - src/avl.h
16 - src/common.c
17 - src/common.h
18 - src/daemon.c
19 - src/daemon.h
20 - src/dictionary.c
21 - src/dictionary.h
22 - src/global_statistics.c
23 - src/global_statistics.h
24 - src/log.c
25 - src/log.h
26 - src/main.c
27 - src/main.h
28 - src/plugin_checks.c
29 - src/plugin_checks.h
30 - src/plugin_idlejitter.c
31 - src/plugin_idlejitter.h
32 - src/plugin_nfacct.c
33 - src/plugin_nfacct.h
34 - src/plugin_proc.c
35 - src/plugin_proc.h
36 - src/plugins_d.c
37 - src/plugins_d.h
38 - src/plugin_tc.c
39 - src/plugin_tc.h
40 - src/popen.c
41 - src/popen.h
42 - src/proc_diskstats.c
43 - src/procfile.c
44 - src/procfile.h
45 - src/proc_interrupts.c
46 - src/proc_loadavg.c
47 - src/proc_meminfo.c
48 - src/proc_net_dev.c
49 - src/proc_net_ip_vs_stats.c
50 - src/proc_net_netstat.c
51 - src/proc_net_rpc_nfsd.c
52 - src/proc_net_snmp6.c
53 - src/proc_net_snmp.c
54 - src/proc_net_stat_conntrack.c
55 - src/proc_net_stat_synproxy.c
56 - src/proc_softirqs.c
57 - src/proc_stat.c
58 - src/proc_sys_kernel_random_entropy_avail.c
59 - src/proc_vmstat.c
60 - src/registry.c
61 - src/registry.h
62 - src/rrd2json.c
63 - src/rrd2json.h
64 - src/rrd.c
65 - src/rrd.h
66 - src/storage_number.c
67 - src/storage_number.h
68 - src/sys_kernel_mm_ksm.c
69 - src/sys_fs_cgroup.c
70 - src/unit_test.c
71 - src/unit_test.h
72 - src/url.c
73 - src/url.h
74 - src/web_buffer.c
75 - src/web_buffer.h
76 - src/web_client.c
77 - src/web_client.h
78 - src/web_server.c
79 - src/web_server.h
13 + src/appconfig.c
14 + src/appconfig.h
15 + src/avl.c
16 + src/avl.h
17 + src/common.c
18 + src/common.h
19 + src/daemon.c
20 + src/daemon.h
21 + src/dictionary.c
22 + src/dictionary.h
23 + src/global_statistics.c
24 + src/global_statistics.h
25 + src/log.c
26 + src/log.h
27 + src/main.c
28 + src/main.h
29 + src/plugin_checks.c
30 + src/plugin_checks.h
31 + src/plugin_idlejitter.c
32 + src/plugin_idlejitter.h
33 + src/plugin_nfacct.c
34 + src/plugin_nfacct.h
35 + src/plugin_proc.c
36 + src/plugin_proc.h
37 + src/plugins_d.c
38 + src/plugins_d.h
39 + src/plugin_tc.c
40 + src/plugin_tc.h
41 + src/popen.c
42 + src/popen.h
43 + src/proc_diskstats.c
44 + src/procfile.c
45 + src/procfile.h
46 + src/proc_interrupts.c
47 + src/proc_loadavg.c
48 + src/proc_meminfo.c
49 + src/proc_net_dev.c
50 + src/proc_net_ip_vs_stats.c
51 + src/proc_net_netstat.c
52 + src/proc_net_rpc_nfsd.c
53 + src/proc_net_snmp6.c
54 + src/proc_net_snmp.c
55 + src/proc_net_stat_conntrack.c
56 + src/proc_net_stat_synproxy.c
57 + src/proc_self_mountinfo.c
58 + src/proc_self_mountinfo.h
59 + src/proc_softirqs.c
60 + src/proc_stat.c
61 + src/proc_sys_kernel_random_entropy_avail.c
62 + src/proc_vmstat.c
63 + src/registry.c
64 + src/registry.h
65 + src/rrd2json.c
66 + src/rrd2json.h
67 + src/rrd.c
68 + src/rrd.h
69 + src/storage_number.c
70 + src/storage_number.h
71 + src/sys_kernel_mm_ksm.c
72 + src/sys_fs_cgroup.c
73 + src/unit_test.c
74 + src/unit_test.h
75 + src/url.c
76 + src/url.h
77 + src/web_buffer.c
78 + src/web_buffer.h
79 + src/web_buffer_svg.c
80 + src/web_buffer_svg.h
81 + src/web_client.c
82 + src/web_client.h
83 + src/web_server.c
84 + src/web_server.h
85 config.h)
86
87 set(APPS_PLUGIN_SOURCE_FILES
83 - src/appconfig.c
84 - src/appconfig.h
85 - src/apps_plugin.c
86 - src/avl.c
87 - src/avl.h
88 - src/common.c
89 - src/common.h
90 - src/log.c
91 - src/log.h
88 + src/appconfig.c
89 + src/appconfig.h
90 + src/apps_plugin.c
91 + src/avl.c
92 + src/avl.h
93 + src/common.c
94 + src/common.h
95 + src/log.c
96 + src/log.h
97 + src/procfile.c
98 + src/procfile.h
99 + src/storage_number.c
100 + src/storage_number.h
101 + src/web_buffer.c
102 + src/web_buffer.h
103 config.h)
104
105 include_directories(AFTER .)
106
96 -add_definitions(-DHAVE_CONFIG_H -DNETDATA_INTERNAL_CHECKS=1 -DCACHE_DIR="/tmp" -DCONFIG_DIR="/tmp" -DLOG_DIR="/tmp" -DPLUGINS_DIR="/tmp" -DWEB_DIR="/tmp" -DVARLIB_DIR="/tmp")
107 +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")
108
109 add_executable(netdata ${NETDATA_SOURCE_FILES})
110 +target_link_libraries (netdata m z uuid ${CMAKE_THREAD_LIBS_INIT})
111 +
112 add_executable(apps.plugin ${APPS_PLUGIN_SOURCE_FILES})
113 +target_link_libraries (apps.plugin m ${CMAKE_THREAD_LIBS_INIT})