Merge pull request #6015 from Icinga/fix/cmakelist-whitespace

Fix whitespaces in CMakeLists files
This commit is contained in:
Michael Friedrich 2018-01-19 11:11:43 +01:00 committed by GitHub
commit 627fddf12b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 183 additions and 182 deletions

View File

@ -24,8 +24,8 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third-party/cmake")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
"Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)

View File

@ -16,7 +16,7 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
if(NOT WIN32)
set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
set(ICINGA2_SYSCONFIGFILE "${CMAKE_INSTALL_FULL_SYSCONFDIR}/sysconfig/icinga2" CACHE PATH "where to store configuation for the init system, defaults to /etc/sysconfig/icinga2")
configure_file(icinga2.sysconfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2.sysconfig @ONLY)
get_filename_component(ICINGA2_SYSCONFIGFILE_NAME ${ICINGA2_SYSCONFIGFILE} NAME)
@ -35,11 +35,11 @@ if(NOT WIN32)
)
option (USE_SYSTEMD
"Configure icinga as native systemd service instead of a SysV initscript" OFF)
"Configure icinga as native systemd service instead of a SysV initscript" OFF)
# required for packaging on Gentoo, see Bug #6498
option (INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT
"Force install both the systemd service definition file and the SysV initscript in parallel, regardless of how USE_SYSTEMD is set. Only use this for special packaging purposes and if you know what you are doing" OFF)
"Force install both the systemd service definition file and the SysV initscript in parallel, regardless of how USE_SYSTEMD is set. Only use this for special packaging purposes and if you know what you are doing" OFF)
if (NOT USE_SYSTEMD OR INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT)
configure_file(icinga2.init.d.cmake ${CMAKE_CURRENT_BINARY_DIR}/initsystem/icinga2)

View File

@ -16,11 +16,11 @@
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
set(icinga_installer_SOURCES
@ -40,13 +40,13 @@ target_link_libraries(icinga-installer shlwapi)
install(CODE "
execute_process(COMMAND \${CMAKE_COMMAND} -E copy \"${CMAKE_CURRENT_BINARY_DIR}/icinga2.wixpatch.\${BUILD_TYPE}\"
\"${CMAKE_CURRENT_BINARY_DIR}/icinga2.wixpatch\"
RESULT_VARIABLE copy_result
ERROR_VARIABLE error_output)
\"${CMAKE_CURRENT_BINARY_DIR}/icinga2.wixpatch\"
RESULT_VARIABLE copy_result
ERROR_VARIABLE error_output)
if(copy_result)
message(FATAL_ERROR \${error_output})
endif()
")
endif()"
)
file(
GENERATE

View File

@ -94,7 +94,7 @@ set(base_SOURCES
set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE)
if(ICINGA2_UNITY_BUILD)
mkunity_target(base base base_SOURCES)
mkunity_target(base base base_SOURCES)
endif()
add_library(base OBJECT ${base_SOURCES})

View File

@ -22,7 +22,7 @@ set(checker_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(checker checker checker_SOURCES)
mkunity_target(checker checker checker_SOURCES)
endif()
add_library(checker OBJECT ${checker_SOURCES})

View File

@ -48,7 +48,7 @@ set(cli_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(cli cli cli_SOURCES)
mkunity_target(cli cli cli_SOURCES)
endif()
add_library(cli OBJECT ${cli_SOURCES})

View File

@ -28,7 +28,7 @@ set(compat_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(compat compat compat_SOURCES)
mkunity_target(compat compat compat_SOURCES)
endif()
add_library(compat OBJECT ${compat_SOURCES})

View File

@ -49,7 +49,7 @@ set(config_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(config config config_SOURCES)
mkunity_target(config config config_SOURCES)
endif()
add_library(config OBJECT ${config_SOURCES})

View File

@ -42,7 +42,7 @@ set(db_ido_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(db_ido db_ido db_ido_SOURCES)
mkunity_target(db_ido db_ido db_ido_SOURCES)
endif()
add_library(db_ido OBJECT ${db_ido_SOURCES})

View File

@ -22,7 +22,7 @@ set(db_ido_mysql_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(db_ido_mysql db_ido_mysql db_ido_mysql_SOURCES)
mkunity_target(db_ido_mysql db_ido_mysql db_ido_mysql_SOURCES)
endif()
add_library(db_ido_mysql OBJECT ${db_ido_mysql_SOURCES})

View File

@ -22,7 +22,7 @@ set(db_ido_pgsql_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(db_ido_pgsql db_ido_pgsql db_ido_pgsql_SOURCES)
mkunity_target(db_ido_pgsql db_ido_pgsql db_ido_pgsql_SOURCES)
endif()
add_library(db_ido_pgsql OBJECT ${db_ido_pgsql_SOURCES})

View File

@ -77,7 +77,7 @@ set(icinga_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(icinga icinga icinga_SOURCES)
mkunity_target(icinga icinga icinga_SOURCES)
endif()
add_library(icinga OBJECT ${icinga_SOURCES})

View File

@ -58,7 +58,7 @@ set(livestatus_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(livestatus livestatus livestatus_SOURCES)
mkunity_target(livestatus livestatus livestatus_SOURCES)
endif()
add_library(livestatus OBJECT ${livestatus_SOURCES})

View File

@ -41,7 +41,7 @@ set(methods_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(methods methods methods_SOURCES)
mkunity_target(methods methods methods_SOURCES)
endif()
add_library(methods OBJECT ${methods_SOURCES})

View File

@ -23,7 +23,7 @@ set(mysql_shim_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(mysql_shim mysql_shim mysql_shim_SOURCES)
mkunity_target(mysql_shim mysql_shim mysql_shim_SOURCES)
endif()
add_library(mysql_shim SHARED ${mysql_shim_SOURCES})

View File

@ -22,7 +22,7 @@ set(notification_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(notification notification notification_SOURCES)
mkunity_target(notification notification notification_SOURCES)
endif()
add_library(notification OBJECT ${notification_SOURCES})

View File

@ -32,7 +32,7 @@ set(perfdata_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(perfdata perfdata perfdata_SOURCES)
mkunity_target(perfdata perfdata perfdata_SOURCES)
endif()
add_library(perfdata OBJECT ${perfdata_SOURCES})

View File

@ -24,7 +24,7 @@ set(pgsql_shim_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(pgsql_shim pgsql_shim pgsql_shim_SOURCES)
mkunity_target(pgsql_shim pgsql_shim pgsql_shim_SOURCES)
endif()
add_library(pgsql_shim SHARED ${pgsql_shim_SOURCES})

View File

@ -64,7 +64,7 @@ set(remote_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(remote remote remote_SOURCES)
mkunity_target(remote remote remote_SOURCES)
endif()
add_library(remote OBJECT ${remote_SOURCES})

View File

@ -31,31 +31,31 @@ set_target_properties (
# Prefer the PluginDir constant which is set to /sbin on Windows
if(WIN32)
install(TARGETS check_nscp_api RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
install(TARGETS check_nscp_api RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR})
else()
install(TARGETS check_nscp_api RUNTIME DESTINATION ${ICINGA2_PLUGINDIR})
install(TARGETS check_nscp_api RUNTIME DESTINATION ${ICINGA2_PLUGINDIR})
endif()
if (WIN32)
add_definitions(-DUNICODE -D_UNICODE)
add_definitions(-DUNICODE -D_UNICODE)
set(thresholds_SOURCES
thresholds.cpp thresholds.h
)
set(thresholds_SOURCES
thresholds.cpp thresholds.h
)
add_library(thresholds ${thresholds_SOURCES})
add_library(thresholds ${thresholds_SOURCES})
set_target_properties(
thresholds PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
FOLDER Plugins
)
set_target_properties(
thresholds PROPERTIES
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
FOLDER Plugins
)
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
)
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
)
foreach(source ${check_SOURCES})
string(REGEX REPLACE ".cpp\$" "" check_OUT "${source}")

View File

@ -51,95 +51,96 @@ set(base_test_SOURCES
)
if(ICINGA2_UNITY_BUILD)
mkunity_target(base test base_test_SOURCES)
mkunity_target(base test base_test_SOURCES)
endif()
add_boost_test(base
SOURCES test-runner.cpp ${base_test_SOURCES}
LIBRARIES ${base_DEPS}
TESTS base_array/construct
base_array/getset
base_array/resize
base_array/insert
base_array/remove
base_array/foreach
base_array/clone
base_array/json
base_base64/base64
base_convert/tolong
base_convert/todouble
base_convert/tostring
base_convert/tobool
base_dictionary/construct
base_dictionary/get1
base_dictionary/get2
base_dictionary/foreach
base_dictionary/remove
base_dictionary/clone
base_dictionary/json
base_fifo/construct
base_fifo/io
base_json/invalid1
base_match/tolong
base_netstring/netstring
base_object/construct
base_object/getself
base_serialize/scalar
base_serialize/array
base_serialize/dictionary
base_serialize/object
base_shellescape/escape_basic
base_shellescape/escape_quoted
base_stacktrace/stacktrace
base_stream/readline_stdio
base_string/construct
base_string/equal
base_string/clear
base_string/append
base_string/trim
base_string/contains
base_string/replace
base_string/index
base_string/find
base_timer/construct
base_timer/interval
base_timer/invoke
base_timer/scope
base_type/gettype
base_type/assign
base_type/byname
base_type/instantiate
base_value/scalar
base_value/convert
base_value/format
config_ops/simple
config_ops/advanced
icinga_checkresult/host_1attempt
icinga_checkresult/host_2attempts
icinga_checkresult/host_3attempts
icinga_checkresult/service_1attempt
icinga_checkresult/service_2attempts
icinga_checkresult/service_3attempts
icinga_checkresult/host_flapping_notification
icinga_checkresult/service_flapping_notification
icinga_notification/state_filter
icinga_notification/type_filter
icinga_macros/simple
icinga_legacytimeperiod/simple
icinga_perfdata/empty
icinga_perfdata/simple
icinga_perfdata/quotes
icinga_perfdata/multiple
icinga_perfdata/uom
icinga_perfdata/warncritminmax
icinga_perfdata/ignore_invalid_warn_crit_min_max
icinga_perfdata/invalid
icinga_perfdata/multi
remote_url/id_and_path
remote_url/parameters
remote_url/get_and_set
remote_url/format
remote_url/illegal_legal_strings
TESTS
base_array/construct
base_array/getset
base_array/resize
base_array/insert
base_array/remove
base_array/foreach
base_array/clone
base_array/json
base_base64/base64
base_convert/tolong
base_convert/todouble
base_convert/tostring
base_convert/tobool
base_dictionary/construct
base_dictionary/get1
base_dictionary/get2
base_dictionary/foreach
base_dictionary/remove
base_dictionary/clone
base_dictionary/json
base_fifo/construct
base_fifo/io
base_json/invalid1
base_match/tolong
base_netstring/netstring
base_object/construct
base_object/getself
base_serialize/scalar
base_serialize/array
base_serialize/dictionary
base_serialize/object
base_shellescape/escape_basic
base_shellescape/escape_quoted
base_stacktrace/stacktrace
base_stream/readline_stdio
base_string/construct
base_string/equal
base_string/clear
base_string/append
base_string/trim
base_string/contains
base_string/replace
base_string/index
base_string/find
base_timer/construct
base_timer/interval
base_timer/invoke
base_timer/scope
base_type/gettype
base_type/assign
base_type/byname
base_type/instantiate
base_value/scalar
base_value/convert
base_value/format
config_ops/simple
config_ops/advanced
icinga_checkresult/host_1attempt
icinga_checkresult/host_2attempts
icinga_checkresult/host_3attempts
icinga_checkresult/service_1attempt
icinga_checkresult/service_2attempts
icinga_checkresult/service_3attempts
icinga_checkresult/host_flapping_notification
icinga_checkresult/service_flapping_notification
icinga_notification/state_filter
icinga_notification/type_filter
icinga_macros/simple
icinga_legacytimeperiod/simple
icinga_perfdata/empty
icinga_perfdata/simple
icinga_perfdata/quotes
icinga_perfdata/multiple
icinga_perfdata/uom
icinga_perfdata/warncritminmax
icinga_perfdata/ignore_invalid_warn_crit_min_max
icinga_perfdata/invalid
icinga_perfdata/multi
remote_url/id_and_path
remote_url/parameters
remote_url/get_and_set
remote_url/format
remote_url/illegal_legal_strings
)
if(ICINGA2_WITH_LIVESTATUS)

View File

@ -48,11 +48,11 @@ set_target_properties (
)
macro(MKCLASS_TARGET ClassInput ClassImplOutput ClassHeaderOutput)
add_custom_command(
OUTPUT ${ClassImplOutput} ${ClassHeaderOutput}
COMMAND mkclass
ARGS ${ClassInput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassImplOutput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassHeaderOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkclass ${ClassInput}
)
add_custom_command(
OUTPUT ${ClassImplOutput} ${ClassHeaderOutput}
COMMAND mkclass
ARGS ${ClassInput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassImplOutput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassHeaderOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkclass ${ClassInput}
)
endmacro()

View File

@ -27,13 +27,13 @@ set_target_properties (
)
macro(MKEMBEDCONFIG_TARGET EmbedInput EmbedOutput)
add_custom_command(
OUTPUT ${EmbedOutput}
COMMAND mkembedconfig
ARGS ${EmbedInput} ${CMAKE_CURRENT_BINARY_DIR}/${EmbedOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkembedconfig ${EmbedInput}
)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${EmbedOutput} PROPERTY EXCLUDE_UNITY_BUILD TRUE)
add_custom_command(
OUTPUT ${EmbedOutput}
COMMAND mkembedconfig
ARGS ${EmbedInput} ${CMAKE_CURRENT_BINARY_DIR}/${EmbedOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkembedconfig ${EmbedInput}
)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/${EmbedOutput} PROPERTY EXCLUDE_UNITY_BUILD TRUE)
endmacro()

View File

@ -23,40 +23,40 @@ define_property(
)
if(ICINGA2_UNITY_BUILD)
set(mkunity_SOURCES
mkunity.c
set(mkunity_SOURCES
mkunity.c
)
add_executable(mkunity ${mkunity_SOURCES})
set_target_properties (
mkunity PROPERTIES
FOLDER Bin
)
function(MKUNITY_TARGET Target Prefix UnityInputRef)
set(UnityInput ${${UnityInputRef}})
set(UnityOutput ${CMAKE_CURRENT_BINARY_DIR}/${Target}_unity.cpp)
set(RealSources "")
set(UnitySources "")
foreach(UnitySource ${UnityInput})
get_property(SourceExcluded SOURCE ${UnitySource} PROPERTY EXCLUDE_UNITY_BUILD)
if(SourceExcluded MATCHES TRUE OR NOT ${UnitySource} MATCHES "\\.(cpp|cxx|cc)\$")
list(APPEND RealSources ${UnitySource})
else()
list(APPEND UnitySources ${UnitySource})
endif()
endforeach()
add_custom_command(
OUTPUT ${UnityOutput}
COMMAND mkunity
ARGS ${Prefix} ${UnitySources} > ${UnityOutput}.tmp
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${UnityOutput}.tmp ${UnityOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkunity ${UnitySources}
)
add_executable(mkunity ${mkunity_SOURCES})
set_target_properties (
mkunity PROPERTIES
FOLDER Bin
)
function(MKUNITY_TARGET Target Prefix UnityInputRef)
set(UnityInput ${${UnityInputRef}})
set(UnityOutput ${CMAKE_CURRENT_BINARY_DIR}/${Target}_unity.cpp)
set(RealSources "")
set(UnitySources "")
foreach(UnitySource ${UnityInput})
get_property(SourceExcluded SOURCE ${UnitySource} PROPERTY EXCLUDE_UNITY_BUILD)
if(SourceExcluded MATCHES TRUE OR NOT ${UnitySource} MATCHES "\\.(cpp|cxx|cc)\$")
list(APPEND RealSources ${UnitySource})
else()
list(APPEND UnitySources ${UnitySource})
endif()
endforeach()
add_custom_command(
OUTPUT ${UnityOutput}
COMMAND mkunity
ARGS ${Prefix} ${UnitySources} > ${UnityOutput}.tmp
COMMAND ${CMAKE_COMMAND}
ARGS -E copy ${UnityOutput}.tmp ${UnityOutput}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS mkunity ${UnitySources}
)
list(APPEND RealSources ${UnityOutput})
set(${UnityInputRef} ${RealSources} PARENT_SCOPE)
endfunction()
list(APPEND RealSources ${UnityOutput})
set(${UnityInputRef} ${RealSources} PARENT_SCOPE)
endfunction()
endif()