2019-02-25 15:09:36 +01:00
|
|
|
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
|
2014-11-07 13:32:20 +01:00
|
|
|
|
2018-01-17 04:28:21 +01:00
|
|
|
add_executable(check_nscp_api
|
|
|
|
check_nscp_api.cpp
|
2018-01-17 14:59:02 +01:00
|
|
|
${base_OBJS}
|
2018-01-17 04:28:21 +01:00
|
|
|
$<TARGET_OBJECTS:config>
|
|
|
|
$<TARGET_OBJECTS:remote>
|
|
|
|
)
|
|
|
|
target_link_libraries(check_nscp_api ${base_DEPS})
|
2016-10-10 11:42:18 +02:00
|
|
|
set_target_properties (
|
|
|
|
check_nscp_api PROPERTIES
|
|
|
|
DEFINE_SYMBOL I2_PLUGINS_BUILD
|
2017-12-24 08:18:33 +01:00
|
|
|
FOLDER Plugins)
|
2016-10-10 11:42:18 +02:00
|
|
|
|
|
|
|
# Prefer the PluginDir constant which is set to /sbin on Windows
|
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
if(WIN32)
|
2018-01-19 09:18:52 +01:00
|
|
|
install(TARGETS check_nscp_api RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
|
2016-10-10 11:42:18 +02:00
|
|
|
else()
|
2018-01-19 09:18:52 +01:00
|
|
|
install(TARGETS check_nscp_api RUNTIME DESTINATION ${ICINGA2_PLUGINDIR})
|
2016-10-10 11:42:18 +02:00
|
|
|
endif()
|
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
if (WIN32)
|
2018-01-19 09:18:52 +01:00
|
|
|
add_definitions(-DUNICODE -D_UNICODE)
|
2014-11-06 15:17:08 +01:00
|
|
|
|
2018-01-19 09:18:52 +01:00
|
|
|
set(thresholds_SOURCES
|
2018-02-01 08:45:09 +01:00
|
|
|
thresholds.cpp thresholds.hpp
|
2018-01-19 09:18:52 +01:00
|
|
|
)
|
2016-10-10 11:42:18 +02:00
|
|
|
|
2018-01-19 09:18:52 +01:00
|
|
|
add_library(thresholds ${thresholds_SOURCES})
|
2017-12-24 08:18:33 +01:00
|
|
|
|
2018-01-19 09:18:52 +01:00
|
|
|
set_target_properties(
|
|
|
|
thresholds PROPERTIES
|
|
|
|
FOLDER Plugins
|
|
|
|
)
|
2016-10-10 11:42:18 +02:00
|
|
|
|
2018-01-19 09:18:52 +01:00
|
|
|
set(check_SOURCES
|
|
|
|
check_disk.cpp check_load.cpp check_memory.cpp check_network.cpp check_perfmon.cpp
|
|
|
|
check_ping.cpp check_procs.cpp check_service.cpp check_swap.cpp check_update.cpp check_uptime.cpp
|
|
|
|
check_users.cpp
|
|
|
|
)
|
2016-10-10 11:42:18 +02:00
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
foreach(source ${check_SOURCES})
|
|
|
|
string(REGEX REPLACE ".cpp\$" "" check_OUT "${source}")
|
2016-10-10 11:42:18 +02:00
|
|
|
|
2018-02-01 08:45:09 +01:00
|
|
|
add_executable(${check_OUT} ${source})
|
|
|
|
target_link_libraries(${check_OUT} thresholds shlwapi.lib ${Boost_PROGRAM_OPTIONS_LIBRARY})
|
2016-10-10 11:42:18 +02:00
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
set_target_properties(
|
2014-11-07 13:32:20 +01:00
|
|
|
${check_OUT} PROPERTIES
|
|
|
|
DEFINE_SYMBOL I2_PLUGINS_BUILD
|
2017-12-24 08:18:33 +01:00
|
|
|
FOLDER Plugins
|
|
|
|
)
|
|
|
|
endforeach()
|
2014-11-06 15:17:08 +01:00
|
|
|
|
2018-02-01 08:45:09 +01:00
|
|
|
target_link_libraries(check_load pdh.lib)
|
|
|
|
target_link_libraries(check_network pdh.lib iphlpapi.lib)
|
|
|
|
target_link_libraries(check_perfmon pdh.lib)
|
|
|
|
target_link_libraries(check_ping ntdll.lib iphlpapi.lib ws2_32.lib)
|
|
|
|
target_link_libraries(check_procs pdh.lib)
|
2017-12-24 08:18:33 +01:00
|
|
|
target_link_libraries(check_uptime ${Boost_SYSTEM_LIBRARY})
|
|
|
|
target_link_libraries(check_users wtsapi32.lib)
|
2014-11-06 15:17:08 +01:00
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
install(
|
2016-10-10 11:42:18 +02:00
|
|
|
TARGETS check_disk check_load check_memory check_network check_perfmon check_procs
|
2015-03-23 13:07:02 +01:00
|
|
|
check_ping check_service check_swap check_update check_uptime check_users
|
2017-12-24 08:18:33 +01:00
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
|
|
|
)
|
2015-03-23 13:07:02 +01:00
|
|
|
endif ( )
|