2 # Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18 add_executable ( check_nscp_api check_nscp_api.cpp )
19 target_link_libraries ( check_nscp_api ${Boost_PROGRAM_OPTIONS_LIBRARY} ${Boost_SYSTEM_LIBRARY})
20 add_whole_static_library(check_nscp_api base)
21 add_whole_static_library(check_nscp_api config)
22 add_whole_static_library(check_nscp_api remote)
23 set_target_properties (
24 check_nscp_api PROPERTIES
25 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
26 DEFINE_SYMBOL I2_PLUGINS_BUILD
29 # Prefer the PluginDir constant which is set to /sbin on Windows
32 install(TARGETS check_nscp_api RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
34 install(TARGETS check_nscp_api RUNTIME DESTINATION ${ICINGA2_PLUGINDIR})
38 add_definitions(-DUNICODE -D_UNICODE)
40 set(thresholds_SOURCES
41 thresholds.cpp thresholds.h
44 add_library(thresholds ${thresholds_SOURCES})
46 set_target_properties(
48 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
53 check_disk.cpp check_load.cpp check_memory.cpp check_network.cpp check_perfmon.cpp
54 check_ping.cpp check_procs.cpp check_service.cpp check_swap.cpp check_update.cpp check_uptime.cpp
58 foreach(source ${check_SOURCES})
59 string(REGEX REPLACE ".cpp\$" "" check_OUT "${source}")
60 string(REGEX REPLACE ".cpp\$" ".h" check_HEADER "${source}")
62 add_executable(${check_OUT} ${source} ${check_HEADER})
63 target_link_libraries(${check_OUT} thresholds Shlwapi.lib ${Boost_PROGRAM_OPTIONS_LIBRARY})
65 set_target_properties(
66 ${check_OUT} PROPERTIES
67 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
68 DEFINE_SYMBOL I2_PLUGINS_BUILD
73 target_link_libraries(check_load Pdh.lib)
74 target_link_libraries(check_network Pdh.lib Iphlpapi.lib)
75 target_link_libraries(check_perfmon Pdh.lib)
76 target_link_libraries(check_ping Ntdll.lib iphlpapi.lib Ws2_32.lib)
77 target_link_libraries(check_procs Pdh.lib)
78 target_link_libraries(check_uptime ${Boost_SYSTEM_LIBRARY})
79 target_link_libraries(check_users wtsapi32.lib)
82 TARGETS check_disk check_load check_memory check_network check_perfmon check_procs
83 check_ping check_service check_swap check_update check_uptime check_users
84 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}