From 75e2473616ad836e7a2515d0fda1b1bbf79d37a5 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Sun, 24 Dec 2017 08:18:33 +0100 Subject: [PATCH] Clean up source lists in the CMakeLists.txt files --- icinga-installer/CMakeLists.txt | 6 +- icinga-studio/CMakeLists.txt | 13 +++- lib/base/CMakeLists.txt | 78 +++++++++++++++---- lib/checker/CMakeLists.txt | 2 +- lib/cli/CMakeLists.txt | 40 +++++++--- lib/compat/CMakeLists.txt | 7 +- lib/config/CMakeLists.txt | 16 +++- lib/db_ido/CMakeLists.txt | 25 ++++-- lib/db_ido_mysql/CMakeLists.txt | 2 +- lib/db_ido_pgsql/CMakeLists.txt | 2 +- lib/demo/CMakeLists.txt | 2 +- lib/hello/CMakeLists.txt | 2 +- lib/icinga/CMakeLists.txt | 46 ++++++++--- lib/livestatus/CMakeLists.txt | 48 +++++++++--- lib/methods/CMakeLists.txt | 21 +++-- lib/mysql_shim/CMakeLists.txt | 2 +- lib/notification/CMakeLists.txt | 2 +- lib/perfdata/CMakeLists.txt | 7 +- lib/pgsql_shim/CMakeLists.txt | 2 +- lib/remote/CMakeLists.txt | 51 +++++++++--- plugins/CMakeLists.txt | 74 ++++++++++-------- test/CMakeLists.txt | 39 +++++++--- ...-test.cpp => icinga-checkable-fixture.cpp} | 0 third-party/execvpe/CMakeLists.txt | 6 +- third-party/mmatch/CMakeLists.txt | 6 +- third-party/socketpair/CMakeLists.txt | 6 +- tools/mkclass/CMakeLists.txt | 9 ++- tools/mkembedconfig/CMakeLists.txt | 6 +- tools/mkunity/CMakeLists.txt | 6 +- 29 files changed, 385 insertions(+), 141 deletions(-) rename test/{icinga-checkable-test.cpp => icinga-checkable-fixture.cpp} (100%) diff --git a/icinga-installer/CMakeLists.txt b/icinga-installer/CMakeLists.txt index 095f4b9fd..4f6844a13 100644 --- a/icinga-installer/CMakeLists.txt +++ b/icinga-installer/CMakeLists.txt @@ -23,7 +23,11 @@ foreach(flag_var endif(${flag_var} MATCHES "/MD") endforeach(flag_var) -add_executable(icinga-installer icinga-installer.cpp) +set(icinga_installer_SOURCES + icinga-installer.cpp +) + +add_executable(icinga-installer ${icinga_installer_SOURCES}) set_target_properties( icinga-installer PROPERTIES diff --git a/icinga-studio/CMakeLists.txt b/icinga-studio/CMakeLists.txt index bf3aac869..6d281c795 100644 --- a/icinga-studio/CMakeLists.txt +++ b/icinga-studio/CMakeLists.txt @@ -25,9 +25,16 @@ else() set(WindowsSources "") endif() -add_executable(icinga-studio MACOSX_BUNDLE WIN32 icinga-studio.cpp - forms.cpp aboutform.cpp connectform.cpp mainform.cpp - icinga.icns ${WindowsSources}) +set(icinga_studio_SOURCES + icinga-studio.cpp + forms.cpp + aboutform.cpp aboutform.hpp + connectform.cpp connectform.hpp + mainform.cpp mainform.hpp + icinga.icns ${WindowsSources} +) + +add_executable(icinga-studio MACOSX_BUNDLE WIN32 ${icinga_studio_SOURCES}) include_directories(${Boost_INCLUDE_DIRS}) target_link_libraries(icinga-studio ${Boost_LIBRARIES} ${wxWidgets_LIBRARIES}) diff --git a/lib/base/CMakeLists.txt b/lib/base/CMakeLists.txt index fd61c8922..e65a5d1fa 100644 --- a/lib/base/CMakeLists.txt +++ b/lib/base/CMakeLists.txt @@ -26,21 +26,69 @@ mkclass_target(streamlogger.ti streamlogger.tcpp streamlogger.thpp) mkclass_target(sysloglogger.ti sysloglogger.tcpp sysloglogger.thpp) set(base_SOURCES - application.cpp application.thpp application-version.cpp array.cpp - array-script.cpp boolean.cpp boolean-script.cpp base64.cpp console.cpp context.cpp - convert.cpp datetime.cpp datetime.thpp datetime-script.cpp debuginfo.cpp dictionary.cpp dictionary-script.cpp - configobject.cpp configobject.thpp configobject-script.cpp configtype.cpp configwriter.cpp dependencygraph.cpp - exception.cpp fifo.cpp filelogger.cpp filelogger.thpp initialize.cpp json.cpp - json-script.cpp library.cpp loader.cpp logger.cpp logger.thpp math-script.cpp - netstring.cpp networkstream.cpp number.cpp number-script.cpp object.cpp - object-script.cpp objectlock.cpp objecttype.cpp primitivetype.cpp process.cpp ringbuffer.cpp scriptframe.cpp - function.cpp function.thpp function-script.cpp - perfdatavalue.cpp perfdatavalue.thpp scriptglobal.cpp - scriptutils.cpp serializer.cpp socket.cpp socketevents.cpp socketevents-epoll.cpp socketevents-poll.cpp stacktrace.cpp - stdiostream.cpp stream.cpp streamlogger.cpp streamlogger.thpp string.cpp string-script.cpp - sysloglogger.cpp sysloglogger.thpp tcpsocket.cpp threadpool.cpp timer.cpp - tlsstream.cpp tlsutility.cpp type.cpp typetype-script.cpp unixsocket.cpp utility.cpp value.cpp - value-operators.cpp workqueue.cpp + i2-base.hpp + application.cpp application.hpp application.thpp application-version.cpp + array.cpp array.hpp array-script.cpp + base64.cpp base64.hpp + boolean.cpp boolean.hpp boolean-script.cpp + configobject.cpp configobject.hpp configobject.thpp configobject-script.cpp + configtype.cpp configtype.hpp + configwriter.cpp configwriter.hpp + console.cpp console.hpp + context.cpp context.hpp + convert.cpp convert.hpp + datetime.cpp datetime.hpp datetime.thpp datetime-script.cpp + debug.hpp + debuginfo.cpp debuginfo.hpp + dependencygraph.cpp dependencygraph.hpp + dictionary.cpp dictionary.hpp dictionary-script.cpp + exception.cpp exception.hpp + fifo.cpp fifo.hpp + filelogger.cpp filelogger.hpp filelogger.thpp + function.cpp function.hpp function.thpp function-script.cpp functionwrapper.hpp + initialize.cpp initialize.hpp + json.cpp json.hpp json-script.cpp + library.cpp library.hpp + loader.cpp loader.hpp + logger.cpp logger.hpp logger.thpp + math-script.cpp + netstring.cpp netstring.hpp + networkstream.cpp networkstream.hpp + number.cpp number.hpp number-script.cpp + object.cpp object.hpp object-script.cpp + objectlock.cpp objectlock.hpp + objecttype.cpp objecttype.hpp + perfdatavalue.cpp perfdatavalue.hpp perfdatavalue.thpp + primitivetype.cpp primitivetype.hpp + process.cpp process.hpp + registry.hpp + ringbuffer.cpp ringbuffer.hpp + scriptframe.cpp scriptframe.hpp + scriptglobal.cpp scriptglobal.hpp + scriptutils.cpp scriptutils.hpp + serializer.cpp serializer.hpp + singleton.hpp + socket.cpp socket.hpp + socketevents.cpp socketevents-epoll.cpp socketevents-poll.cpp socketevents.hpp + stacktrace.cpp stacktrace.hpp + statsfunction.hpp + stdiostream.cpp stdiostream.hpp + stream.cpp stream.hpp + streamlogger.cpp streamlogger.hpp streamlogger.thpp + string.cpp string.hpp string-script.cpp + sysloglogger.cpp sysloglogger.hpp sysloglogger.thpp + tcpsocket.cpp tcpsocket.hpp + threadpool.cpp threadpool.hpp + timer.cpp timer.hpp + tlsstream.cpp tlsstream.hpp + tlsutility.cpp tlsutility.hpp + type.cpp type.hpp typetype-script.cpp + unix.hpp + unixsocket.cpp unixsocket.hpp + utility.cpp utility.hpp + value.cpp value.hpp value-operators.cpp + win32.hpp + workqueue.cpp workqueue.hpp ) set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/application-version.cpp PROPERTY EXCLUDE_UNITY_BUILD TRUE) diff --git a/lib/checker/CMakeLists.txt b/lib/checker/CMakeLists.txt index fe79d0e09..015856264 100644 --- a/lib/checker/CMakeLists.txt +++ b/lib/checker/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(checkercomponent.ti checkercomponent.tcpp checkercomponent.thpp) set(checker_SOURCES - checkercomponent.cpp checkercomponent.thpp + checkercomponent.cpp checkercomponent.hpp checkercomponent.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/cli/CMakeLists.txt b/lib/cli/CMakeLists.txt index dc1768f36..3b946efb4 100644 --- a/lib/cli/CMakeLists.txt +++ b/lib/cli/CMakeLists.txt @@ -16,17 +16,35 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. set(cli_SOURCES - apisetupcommand.cpp apisetuputility.cpp - calistcommand.cpp casigncommand.cpp - nodesetupcommand.cpp nodewizardcommand.cpp nodeutility.cpp - clicommand.cpp - consolecommand.cpp - daemoncommand.cpp daemonutility.cpp - featureenablecommand.cpp featuredisablecommand.cpp featurelistcommand.cpp featureutility.cpp - objectlistcommand.cpp objectlistutility.cpp - pkinewcacommand.cpp pkinewcertcommand.cpp pkisigncsrcommand.cpp pkirequestcommand.cpp pkisavecertcommand.cpp pkiticketcommand.cpp - variablegetcommand.cpp variablelistcommand.cpp variableutility.cpp - troubleshootcommand.cpp + i2-cli.hpp + apisetupcommand.cpp apisetupcommand.hpp + apisetuputility.cpp apisetuputility.hpp + calistcommand.cpp calistcommand.hpp + casigncommand.cpp casigncommand.hpp + clicommand.cpp clicommand.hpp + consolecommand.cpp consolecommand.hpp + daemoncommand.cpp daemoncommand.hpp + daemonutility.cpp daemonutility.hpp + editline.hpp + featuredisablecommand.cpp featuredisablecommand.hpp + featureenablecommand.cpp featureenablecommand.hpp + featurelistcommand.cpp featurelistcommand.hpp + featureutility.cpp featureutility.hpp + nodesetupcommand.cpp nodesetupcommand.hpp + nodeutility.cpp nodeutility.hpp + nodewizardcommand.cpp nodewizardcommand.hpp + objectlistcommand.cpp objectlistcommand.hpp + objectlistutility.cpp objectlistutility.hpp + pkinewcacommand.cpp pkinewcacommand.hpp + pkinewcertcommand.cpp pkinewcertcommand.hpp + pkirequestcommand.cpp pkirequestcommand.hpp + pkisavecertcommand.cpp pkisavecertcommand.hpp + pkisigncsrcommand.cpp pkisigncsrcommand.hpp + pkiticketcommand.cpp pkiticketcommand.hpp + troubleshootcommand.cpp troubleshootcommand.hpp + variablegetcommand.cpp variablegetcommand.hpp + variablelistcommand.cpp variablelistcommand.hpp + variableutility.cpp variableutility.hpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/compat/CMakeLists.txt b/lib/compat/CMakeLists.txt index 1e7b749b4..6ad4d4195 100644 --- a/lib/compat/CMakeLists.txt +++ b/lib/compat/CMakeLists.txt @@ -21,9 +21,10 @@ mkclass_target(externalcommandlistener.ti externalcommandlistener.tcpp externalc mkclass_target(statusdatawriter.ti statusdatawriter.tcpp statusdatawriter.thpp) set(compat_SOURCES - checkresultreader.cpp checkresultreader.thpp compatlogger.cpp - compatlogger.thpp externalcommandlistener.cpp externalcommandlistener.thpp - statusdatawriter.cpp statusdatawriter.thpp + checkresultreader.cpp checkresultreader.hpp checkresultreader.thpp + compatlogger.cpp compatlogger.hpp compatlogger.thpp + externalcommandlistener.cpp externalcommandlistener.hpp externalcommandlistener.thpp + statusdatawriter.cpp statusdatawriter.hpp statusdatawriter.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/config/CMakeLists.txt b/lib/config/CMakeLists.txt index 7fd35b558..d78a31355 100644 --- a/lib/config/CMakeLists.txt +++ b/lib/config/CMakeLists.txt @@ -34,10 +34,18 @@ add_flex_bison_dependency(config_lexer config_parser) include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) set(config_SOURCES - activationcontext.cpp applyrule.cpp - configcompilercontext.cpp configcompiler.cpp configitembuilder.cpp - configitem.cpp ${FLEX_config_lexer_OUTPUTS} ${BISON_config_parser_OUTPUTS} - expression.cpp objectrule.cpp + i2-config.hpp + activationcontext.cpp activationcontext.hpp + applyrule.cpp applyrule.hpp + configcompiler.cpp configcompiler.hpp + configcompilercontext.cpp configcompilercontext.hpp + configfragment.hpp + configitem.cpp configitem.hpp + configitembuilder.cpp configitembuilder.hpp + expression.cpp expression.hpp + objectrule.cpp objectrule.hpp + vmops.hpp + ${FLEX_config_lexer_OUTPUTS} ${BISON_config_parser_OUTPUTS} ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/db_ido/CMakeLists.txt b/lib/db_ido/CMakeLists.txt index 2139c70aa..179e9d9a1 100644 --- a/lib/db_ido/CMakeLists.txt +++ b/lib/db_ido/CMakeLists.txt @@ -20,12 +20,25 @@ mkclass_target(dbconnection.ti dbconnection.tcpp dbconnection.thpp) mkembedconfig_target(db_ido-itl.conf db_ido-itl.cpp) set(db_ido_SOURCES - commanddbobject.cpp dbconnection.cpp dbconnection.thpp - db_ido-itl.cpp dbevents.cpp dbobject.cpp dbquery.cpp - dbreference.cpp dbtype.cpp dbvalue.cpp endpointdbobject.cpp hostdbobject.cpp - hostgroupdbobject.cpp idochecktask.cpp servicedbobject.cpp - servicegroupdbobject.cpp timeperioddbobject.cpp userdbobject.cpp - usergroupdbobject.cpp zonedbobject.cpp + i2-db_ido.hpp db_ido-itl.cpp + commanddbobject.cpp commanddbobject.hpp + dbconnection.cpp dbconnection.hpp dbconnection.thpp + dbevents.cpp dbevents.hpp + dbobject.cpp dbobject.hpp + dbquery.cpp dbquery.hpp + dbreference.cpp dbreference.hpp + dbtype.cpp dbtype.hpp + dbvalue.cpp dbvalue.hpp + endpointdbobject.cpp endpointdbobject.hpp + hostdbobject.cpp hostdbobject.hpp + hostgroupdbobject.cpp hostgroupdbobject.hpp + idochecktask.cpp idochecktask.hpp + servicedbobject.cpp servicedbobject.hpp + servicegroupdbobject.cpp servicegroupdbobject.hpp + timeperioddbobject.cpp timeperioddbobject.hpp + userdbobject.cpp userdbobject.hpp + usergroupdbobject.cpp usergroupdbobject.hpp + zonedbobject.cpp zonedbobject.hpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/db_ido_mysql/CMakeLists.txt b/lib/db_ido_mysql/CMakeLists.txt index 5892a9725..326ac8f6f 100644 --- a/lib/db_ido_mysql/CMakeLists.txt +++ b/lib/db_ido_mysql/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(idomysqlconnection.ti idomysqlconnection.tcpp idomysqlconnection.thpp) set(db_ido_mysql_SOURCES - idomysqlconnection.cpp idomysqlconnection.thpp + idomysqlconnection.cpp idomysqlconnection.hpp idomysqlconnection.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/db_ido_pgsql/CMakeLists.txt b/lib/db_ido_pgsql/CMakeLists.txt index a1b5e0913..1b7d5ccbe 100644 --- a/lib/db_ido_pgsql/CMakeLists.txt +++ b/lib/db_ido_pgsql/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(idopgsqlconnection.ti idopgsqlconnection.tcpp idopgsqlconnection.thpp) set(db_ido_pgsql_SOURCES - idopgsqlconnection.cpp idopgsqlconnection.thpp + idopgsqlconnection.cpp idopgsqlconnection.hpp idopgsqlconnection.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/demo/CMakeLists.txt b/lib/demo/CMakeLists.txt index 07d8554b0..9882cf2be 100644 --- a/lib/demo/CMakeLists.txt +++ b/lib/demo/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(demo.ti demo.tcpp demo.thpp) set(demo_SOURCES - demo.cpp demo.thpp + demo.cpp demo.hpp demo.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/hello/CMakeLists.txt b/lib/hello/CMakeLists.txt index fa149d1f6..707f1ee68 100644 --- a/lib/hello/CMakeLists.txt +++ b/lib/hello/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(helloapplication.ti helloapplication.tcpp helloapplication.thpp) set(hello_SOURCES - helloapplication.cpp helloapplication.thpp + helloapplication.cpp helloapplication.hpp helloapplication.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/icinga/CMakeLists.txt b/lib/icinga/CMakeLists.txt index acfb55f45..fa2801e34 100644 --- a/lib/icinga/CMakeLists.txt +++ b/lib/icinga/CMakeLists.txt @@ -39,17 +39,41 @@ mkclass_target(user.ti user.tcpp user.thpp) mkembedconfig_target(icinga-itl.conf icinga-itl.cpp) set(icinga_SOURCES - apiactions.cpp apievents.cpp checkable.cpp checkable.thpp checkable-dependency.cpp checkable-downtime.cpp checkable-event.cpp - checkable-flapping.cpp checkable-script.cpp checkcommand.cpp checkcommand.thpp checkresult.cpp checkresult.thpp - cib.cpp clusterevents.cpp command.cpp command.thpp comment.cpp comment.thpp compatutility.cpp dependency.cpp dependency.thpp - dependency-apply.cpp downtime.cpp downtime.thpp eventcommand.cpp eventcommand.thpp - externalcommandprocessor.cpp host.cpp host.thpp hostgroup.cpp hostgroup.thpp icingaapplication.cpp icingaapplication.thpp - icinga-itl.cpp customvarobject.cpp customvarobject.thpp - legacytimeperiod.cpp macroprocessor.cpp notificationcommand.cpp notificationcommand.thpp notification.cpp notification.thpp - notification-apply.cpp objectutils.cpp pluginutility.cpp scheduleddowntime.cpp scheduleddowntime.thpp - scheduleddowntime-apply.cpp service-apply.cpp checkable-check.cpp checkable-comment.cpp - service.cpp service.thpp servicegroup.cpp servicegroup.thpp checkable-notification.cpp timeperiod.cpp timeperiod.thpp - user.cpp user.thpp usergroup.cpp usergroup.thpp + i2-icinga.hpp icinga-itl.cpp + apiactions.cpp apiactions.hpp + apievents.cpp apievents.hpp + checkable.cpp checkable.hpp checkable.thpp + checkable-check.cpp checkable-comment.cpp checkable-dependency.cpp + checkable-downtime.cpp checkable-event.cpp checkable-flapping.cpp + checkable-notification.cpp checkable-script.cpp + checkcommand.cpp checkcommand.hpp checkcommand.thpp + checkresult.cpp checkresult.hpp checkresult.thpp + cib.cpp cib.hpp + clusterevents.cpp clusterevents.hpp + command.cpp command.hpp command.thpp + comment.cpp comment.hpp comment.thpp + compatutility.cpp compatutility.hpp + customvarobject.cpp customvarobject.hpp customvarobject.thpp + dependency.cpp dependency.hpp dependency.thpp dependency-apply.cpp + downtime.cpp downtime.hpp downtime.thpp + eventcommand.cpp eventcommand.hpp eventcommand.thpp + externalcommandprocessor.cpp externalcommandprocessor.hpp + host.cpp host.hpp host.thpp + hostgroup.cpp hostgroup.hpp hostgroup.thpp + icingaapplication.cpp icingaapplication.hpp icingaapplication.thpp + legacytimeperiod.cpp legacytimeperiod.hpp + macroprocessor.cpp macroprocessor.hpp + macroresolver.hpp + notification.cpp notification.hpp notification.thpp notification-apply.cpp + notificationcommand.cpp notificationcommand.hpp notificationcommand.thpp + objectutils.cpp objectutils.hpp + pluginutility.cpp pluginutility.hpp + scheduleddowntime.cpp scheduleddowntime.hpp scheduleddowntime.thpp scheduleddowntime-apply.cpp + service.cpp service.hpp service.thpp service-apply.cpp + servicegroup.cpp servicegroup.hpp servicegroup.thpp + timeperiod.cpp timeperiod.hpp timeperiod.thpp + user.cpp user.hpp user.thpp + usergroup.cpp usergroup.hpp usergroup.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/livestatus/CMakeLists.txt b/lib/livestatus/CMakeLists.txt index 0130724c9..e260f8ecf 100644 --- a/lib/livestatus/CMakeLists.txt +++ b/lib/livestatus/CMakeLists.txt @@ -18,17 +18,43 @@ mkclass_target(livestatuslistener.ti livestatuslistener.tcpp livestatuslistener.thpp) set(livestatus_SOURCES - aggregator.cpp andfilter.cpp attributefilter.cpp - avgaggregator.cpp column.cpp combinerfilter.cpp commandstable.cpp - commentstable.cpp contactgroupstable.cpp contactstable.cpp countaggregator.cpp - downtimestable.cpp endpointstable.cpp filter.cpp historytable.cpp - hostgroupstable.cpp hoststable.cpp invavgaggregator.cpp invsumaggregator.cpp - livestatuslistener.cpp livestatuslistener.thpp livestatusquery.cpp - livestatuslogutility.cpp logtable.cpp maxaggregator.cpp - minaggregator.cpp negatefilter.cpp orfilter.cpp - servicegroupstable.cpp servicestable.cpp statehisttable.cpp - statustable.cpp stdaggregator.cpp sumaggregator.cpp table.cpp - timeperiodstable.cpp zonestable.cpp + i2-livestatus.hpp + aggregator.cpp aggregator.hpp + andfilter.cpp andfilter.hpp + attributefilter.cpp attributefilter.hpp + avgaggregator.cpp avgaggregator.hpp + column.cpp column.hpp + combinerfilter.cpp combinerfilter.hpp + commandstable.cpp commandstable.hpp + commentstable.cpp commentstable.hpp + contactgroupstable.cpp contactgroupstable.hpp + contactstable.cpp contactstable.hpp + countaggregator.cpp countaggregator.hpp + downtimestable.cpp downtimestable.hpp + endpointstable.cpp endpointstable.hpp + filter.cpp filter.hpp + historytable.cpp historytable.hpp + hostgroupstable.cpp hostgroupstable.hpp + hoststable.cpp hoststable.hpp + invavgaggregator.cpp invavgaggregator.hpp + invsumaggregator.cpp invsumaggregator.hpp + livestatuslistener.cpp livestatuslistener.hpp livestatuslistener.thpp + livestatuslogutility.cpp livestatuslogutility.hpp + livestatusquery.cpp livestatusquery.hpp + logtable.cpp logtable.hpp + maxaggregator.cpp maxaggregator.hpp + minaggregator.cpp minaggregator.hpp + negatefilter.cpp negatefilter.hpp + orfilter.cpp orfilter.hpp + servicegroupstable.cpp servicegroupstable.hpp + servicestable.cpp servicestable.hpp + statehisttable.cpp statehisttable.hpp + statustable.cpp statustable.hpp + stdaggregator.cpp stdaggregator.hpp + sumaggregator.cpp sumaggregator.hpp + table.cpp table.hpp + timeperiodstable.cpp timeperiodstable.hpp + zonestable.cpp zonestable.hpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/methods/CMakeLists.txt b/lib/methods/CMakeLists.txt index 2b5c3134c..c59fde94f 100644 --- a/lib/methods/CMakeLists.txt +++ b/lib/methods/CMakeLists.txt @@ -18,17 +18,26 @@ mkembedconfig_target(methods-itl.conf methods-itl.cpp) if(MSVC) - set(WindowsSources clrchecktask.cpp) + set(WindowsSources clrchecktask.cpp clrchecktask.hpp) else() set(WindowsSources "") endif() set(methods_SOURCES - clusterchecktask.cpp clusterzonechecktask.cpp dummychecktask.cpp - exceptionchecktask.cpp icingachecktask.cpp methods-itl.cpp - nullchecktask.cpp nulleventtask.cpp - pluginchecktask.cpp plugineventtask.cpp pluginnotificationtask.cpp - randomchecktask.cpp timeperiodtask.cpp ${WindowsSources} + i2-methods.hpp methods-itl.cpp + clusterchecktask.cpp clusterchecktask.hpp + clusterzonechecktask.cpp clusterzonechecktask.hpp + dummychecktask.cpp dummychecktask.hpp + exceptionchecktask.cpp exceptionchecktask.hpp + icingachecktask.cpp icingachecktask.hpp + nullchecktask.cpp nullchecktask.hpp + nulleventtask.cpp nulleventtask.hpp + pluginchecktask.cpp pluginchecktask.hpp + plugineventtask.cpp plugineventtask.hpp + pluginnotificationtask.cpp pluginnotificationtask.hpp + randomchecktask.cpp randomchecktask.hpp + timeperiodtask.cpp timeperiodtask.hpp + ${WindowsSources} ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/mysql_shim/CMakeLists.txt b/lib/mysql_shim/CMakeLists.txt index ceff89802..9d4741823 100644 --- a/lib/mysql_shim/CMakeLists.txt +++ b/lib/mysql_shim/CMakeLists.txt @@ -19,7 +19,7 @@ include_directories(${MYSQL_INCLUDE_DIR}) set(mysql_shim_SOURCES mysql_shim.def - mysqlinterface.cpp + mysqlinterface.cpp mysqlinterface.hpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/notification/CMakeLists.txt b/lib/notification/CMakeLists.txt index d288b8ab5..88e6174a1 100644 --- a/lib/notification/CMakeLists.txt +++ b/lib/notification/CMakeLists.txt @@ -18,7 +18,7 @@ mkclass_target(notificationcomponent.ti notificationcomponent.tcpp notificationcomponent.thpp) set(notification_SOURCES - notificationcomponent.cpp notificationcomponent.thpp + notificationcomponent.cpp notificationcomponent.hpp notificationcomponent.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/perfdata/CMakeLists.txt b/lib/perfdata/CMakeLists.txt index c670660a0..baf28a1a1 100644 --- a/lib/perfdata/CMakeLists.txt +++ b/lib/perfdata/CMakeLists.txt @@ -23,7 +23,12 @@ mkclass_target(opentsdbwriter.ti opentsdbwriter.tcpp opentsdbwriter.thpp) mkclass_target(perfdatawriter.ti perfdatawriter.tcpp perfdatawriter.thpp) set(perfdata_SOURCES - gelfwriter.cpp gelfwriter.thpp graphitewriter.cpp graphitewriter.thpp influxdbwriter.cpp influxdbwriter.thpp elasticsearchwriter.cpp elasticsearchwriter.thpp opentsdbwriter.cpp opentsdbwriter.thpp perfdatawriter.cpp perfdatawriter.thpp + elasticsearchwriter.cpp elasticsearchwriter.hpp elasticsearchwriter.thpp + gelfwriter.cpp gelfwriter.hpp gelfwriter.thpp + graphitewriter.cpp graphitewriter.hpp graphitewriter.thpp + influxdbwriter.cpp influxdbwriter.hpp influxdbwriter.thpp + opentsdbwriter.cpp opentsdbwriter.hpp opentsdbwriter.thpp + perfdatawriter.cpp perfdatawriter.hpp perfdatawriter.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/pgsql_shim/CMakeLists.txt b/lib/pgsql_shim/CMakeLists.txt index 20f09dce3..8a5d1ac4b 100644 --- a/lib/pgsql_shim/CMakeLists.txt +++ b/lib/pgsql_shim/CMakeLists.txt @@ -20,7 +20,7 @@ include_directories(${PostgreSQL_INCLUDE_DIRS}) set(pgsql_shim_SOURCES pgsql_shim.def - pgsqlinterface.cpp + pgsqlinterface.cpp pgsqlinterface.hpp ) if(ICINGA2_UNITY_BUILD) diff --git a/lib/remote/CMakeLists.txt b/lib/remote/CMakeLists.txt index 522125694..2b5cbac8c 100644 --- a/lib/remote/CMakeLists.txt +++ b/lib/remote/CMakeLists.txt @@ -21,17 +21,46 @@ mkclass_target(endpoint.ti endpoint.tcpp endpoint.thpp) mkclass_target(zone.ti zone.tcpp zone.thpp) set(remote_SOURCES - actionshandler.cpp apiaction.cpp apiclient.cpp - apifunction.cpp apilistener.cpp apilistener.thpp apilistener-configsync.cpp - apilistener-filesync.cpp apiuser.cpp apiuser.thpp authority.cpp - consolehandler.cpp configfileshandler.cpp configpackageshandler.cpp configpackageutility.cpp configobjectutility.cpp - configstageshandler.cpp createobjecthandler.cpp deleteobjecthandler.cpp - endpoint.cpp endpoint.thpp eventshandler.cpp eventqueue.cpp filterutility.cpp - httpchunkedencoding.cpp httpclientconnection.cpp httpserverconnection.cpp httphandler.cpp httprequest.cpp httpresponse.cpp - httputility.cpp infohandler.cpp jsonrpc.cpp jsonrpcconnection.cpp jsonrpcconnection-heartbeat.cpp jsonrpcconnection-pki.cpp - messageorigin.cpp modifyobjecthandler.cpp statushandler.cpp objectqueryhandler.cpp templatequeryhandler.cpp - pkiutility.cpp - typequeryhandler.cpp url.cpp variablequeryhandler.cpp zone.cpp zone.thpp + i2-remote.hpp + actionshandler.cpp actionshandler.hpp + apiaction.cpp apiaction.hpp + apiclient.cpp apiclient.hpp + apifunction.cpp apifunction.hpp + apilistener.cpp apilistener.hpp apilistener.thpp apilistener-configsync.cpp apilistener-filesync.cpp + apiuser.cpp apiuser.hpp apiuser.thpp + authority.cpp + configfileshandler.cpp configfileshandler.hpp + configobjectutility.cpp configobjectutility.hpp + configpackageshandler.cpp configpackageshandler.hpp + configpackageutility.cpp configpackageutility.hpp + configstageshandler.cpp configstageshandler.hpp + consolehandler.cpp consolehandler.hpp + createobjecthandler.cpp createobjecthandler.hpp + deleteobjecthandler.cpp deleteobjecthandler.hpp + endpoint.cpp endpoint.hpp endpoint.thpp + eventqueue.cpp eventqueue.hpp + eventshandler.cpp eventshandler.hpp + filterutility.cpp filterutility.hpp + httpchunkedencoding.cpp httpchunkedencoding.hpp + httpclientconnection.cpp httpclientconnection.hpp + httphandler.cpp httphandler.hpp + httprequest.cpp httprequest.hpp + httpresponse.cpp httpresponse.hpp + httpserverconnection.cpp httpserverconnection.hpp + httputility.cpp httputility.hpp + infohandler.cpp infohandler.hpp + jsonrpc.cpp jsonrpc.hpp + jsonrpcconnection.cpp jsonrpcconnection.hpp jsonrpcconnection-heartbeat.cpp jsonrpcconnection-pki.cpp + messageorigin.cpp messageorigin.hpp + modifyobjecthandler.cpp modifyobjecthandler.hpp + objectqueryhandler.cpp objectqueryhandler.hpp + pkiutility.cpp pkiutility.hpp + statushandler.cpp statushandler.hpp + templatequeryhandler.cpp templatequeryhandler.hpp + typequeryhandler.cpp typequeryhandler.hpp + url.cpp url.hpp url-characters.hpp + variablequeryhandler.cpp variablequeryhandler.hpp + zone.cpp zone.hpp zone.thpp ) if(ICINGA2_UNITY_BUILD) diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 0182b6787..e03002946 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -24,57 +24,63 @@ set_target_properties ( check_nscp_api PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 DEFINE_SYMBOL I2_PLUGINS_BUILD - FOLDER Plugins ) + FOLDER Plugins) # Prefer the PluginDir constant which is set to /sbin on Windows -if ( WIN32 ) - install ( TARGETS check_nscp_api RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} ) +if(WIN32) + 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 ) +if (WIN32) + add_definitions(-DUNICODE -D_UNICODE) - add_definitions ( -DUNICODE -D_UNICODE ) + set(thresholds_SOURCES + thresholds.cpp thresholds.h + ) - add_library ( thresholds thresholds ) - set_target_properties ( - thresholds PROPERTIES - INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 - FOLDER Plugins - ) + add_library(thresholds ${thresholds_SOURCES}) - list ( APPEND 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_target_properties( + thresholds PROPERTIES + INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 + FOLDER Plugins + ) - foreach ( source ${check_SOURCES} ) - string ( REGEX REPLACE ".cpp\$" "" check_OUT "${source}" ) - string ( REGEX REPLACE ".cpp\$" ".h" check_HEADER "${source}" ) + 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 + ) - add_executable ( ${check_OUT} ${source} ${check_HEADER} ) - target_link_libraries ( ${check_OUT} thresholds Shlwapi.lib ${Boost_PROGRAM_OPTIONS_LIBRARY} ) + foreach(source ${check_SOURCES}) + string(REGEX REPLACE ".cpp\$" "" check_OUT "${source}") + string(REGEX REPLACE ".cpp\$" ".h" check_HEADER "${source}") - set_target_properties ( + add_executable(${check_OUT} ${source} ${check_HEADER}) + target_link_libraries(${check_OUT} thresholds Shlwapi.lib ${Boost_PROGRAM_OPTIONS_LIBRARY}) + + set_target_properties( ${check_OUT} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2 DEFINE_SYMBOL I2_PLUGINS_BUILD - FOLDER Plugins ) - endforeach ( source ) + FOLDER Plugins + ) + endforeach() - 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 ) - target_link_libraries ( check_uptime ${Boost_SYSTEM_LIBRARY} ) - target_link_libraries ( check_users wtsapi32.lib ) + 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) + target_link_libraries(check_uptime ${Boost_SYSTEM_LIBRARY}) + target_link_libraries(check_users wtsapi32.lib) - install ( + install( TARGETS check_disk check_load check_memory check_network check_perfmon check_procs check_ping check_service check_swap check_update check_uptime check_users - RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} ) - + RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} + ) endif ( ) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 6f4328545..a519fd199 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -20,13 +20,30 @@ set(Boost_USE_STATIC_LIBS OFF) include(BoostTestTargets) set(base_test_SOURCES - base-array.cpp base-base64.cpp base-convert.cpp base-dictionary.cpp base-fifo.cpp - base-json.cpp base-match.cpp base-netstring.cpp base-object.cpp - base-serialize.cpp base-shellescape.cpp base-stacktrace.cpp - base-stream.cpp base-string.cpp base-timer.cpp base-type.cpp - base-value.cpp config-ops.cpp icinga-checkresult.cpp icinga-legacytimeperiod.cpp - icinga-macros.cpp icinga-notification.cpp - icinga-perfdata.cpp remote-url.cpp + base-array.cpp + base-base64.cpp + base-convert.cpp + base-dictionary.cpp + base-fifo.cpp + base-json.cpp + base-match.cpp + base-netstring.cpp + base-object.cpp + base-serialize.cpp + base-shellescape.cpp + base-stacktrace.cpp + base-stream.cpp + base-string.cpp + base-timer.cpp + base-type.cpp + base-value.cpp + config-ops.cpp + icinga-checkresult.cpp + icinga-legacytimeperiod.cpp + icinga-macros.cpp + icinga-notification.cpp + icinga-perfdata.cpp + remote-url.cpp ) if(ICINGA2_UNITY_BUILD) @@ -126,6 +143,7 @@ add_whole_static_library(${base_TARGET_NAME} icinga) if(ICINGA2_WITH_LIVESTATUS) set(livestatus_test_SOURCES + livestatus-fixture.cpp livestatus.cpp ) @@ -134,7 +152,7 @@ if(ICINGA2_WITH_LIVESTATUS) endif() add_boost_test(livestatus - SOURCES test-runner.cpp livestatus-fixture.cpp ${livestatus_test_SOURCES} + SOURCES test-runner.cpp ${livestatus_test_SOURCES} TESTS livestatus/hosts livestatus/services ) @@ -146,7 +164,8 @@ if(ICINGA2_WITH_LIVESTATUS) endif() set(icinga_checkable_test_SOURCES - icinga-checkable-flapping.cpp + icinga-checkable-fixture.cpp + icinga-checkable-flapping.cpp ) if(ICINGA2_UNITY_BUILD) @@ -154,7 +173,7 @@ if(ICINGA2_UNITY_BUILD) endif() add_boost_test(icinga_checkable - SOURCES test-runner.cpp icinga-checkable-test.cpp ${icinga_checkable_test_SOURCES} + SOURCES test-runner.cpp ${icinga_checkable_test_SOURCES} TESTS icinga_checkable_flapping/host_not_flapping icinga_checkable_flapping/host_flapping icinga_checkable_flapping/host_flapping_recover diff --git a/test/icinga-checkable-test.cpp b/test/icinga-checkable-fixture.cpp similarity index 100% rename from test/icinga-checkable-test.cpp rename to test/icinga-checkable-fixture.cpp diff --git a/third-party/execvpe/CMakeLists.txt b/third-party/execvpe/CMakeLists.txt index 4aba91724..9f52f8e15 100644 --- a/third-party/execvpe/CMakeLists.txt +++ b/third-party/execvpe/CMakeLists.txt @@ -15,7 +15,11 @@ # along with this program; if not, write to the Free Software Foundation # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -add_library(execvpe STATIC execvpe.c execvpe.h) +set(execvpe_SOURCES + execvpe.c execvpe.h +) + +add_library(execvpe STATIC ${execvpe_SOURCES}) set_target_properties ( execvpe PROPERTIES diff --git a/third-party/mmatch/CMakeLists.txt b/third-party/mmatch/CMakeLists.txt index 39060cb00..238cf2f51 100644 --- a/third-party/mmatch/CMakeLists.txt +++ b/third-party/mmatch/CMakeLists.txt @@ -15,7 +15,11 @@ # along with this program; if not, write to the Free Software Foundation # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -add_library(mmatch STATIC mmatch.c mmatch.h) +set(mmatch_SOURCES + mmatch.c mmatch.h +) + +add_library(mmatch STATIC ${mmatch_SOURCES}) set_target_properties( mmatch PROPERTIES diff --git a/third-party/socketpair/CMakeLists.txt b/third-party/socketpair/CMakeLists.txt index f154ede8d..fa2f39273 100644 --- a/third-party/socketpair/CMakeLists.txt +++ b/third-party/socketpair/CMakeLists.txt @@ -15,7 +15,11 @@ # along with this program; if not, write to the Free Software Foundation # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -add_library(socketpair STATIC socketpair.c socketpair.h) +set(socketpair_SOURCES + socketpair.c socketpair.h +) + +add_library(socketpair STATIC ${socketpair_SOURCES}) set_target_properties ( socketpair PROPERTIES diff --git a/tools/mkclass/CMakeLists.txt b/tools/mkclass/CMakeLists.txt index d9bbeb54e..e717739f1 100644 --- a/tools/mkclass/CMakeLists.txt +++ b/tools/mkclass/CMakeLists.txt @@ -29,7 +29,14 @@ endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -add_executable(mkclass mkclass.cpp classcompiler.cpp classcompiler.hpp ${FLEX_class_lexer_OUTPUTS} ${BISON_class_parser_OUTPUTS}) +set(mkclass_SOURCES + mkclass.cpp + classcompiler.cpp classcompiler.hpp + ${FLEX_class_lexer_OUTPUTS} + ${BISON_class_parser_OUTPUTS} +) + +add_executable(mkclass ${mkclass_SOURCES}) if(WIN32) target_link_libraries(mkclass shlwapi) diff --git a/tools/mkembedconfig/CMakeLists.txt b/tools/mkembedconfig/CMakeLists.txt index 7fb8ac252..9c7ae99ed 100644 --- a/tools/mkembedconfig/CMakeLists.txt +++ b/tools/mkembedconfig/CMakeLists.txt @@ -15,7 +15,11 @@ # along with this program; if not, write to the Free Software Foundation # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. -add_executable(mkembedconfig mkembedconfig.c) +set(mkembedconfig_SOURCES + mkembedconfig.c +) + +add_executable(mkembedconfig ${mkembedconfig_SOURCES}) set_target_properties ( mkembedconfig PROPERTIES diff --git a/tools/mkunity/CMakeLists.txt b/tools/mkunity/CMakeLists.txt index 6337d2644..27ab3119a 100644 --- a/tools/mkunity/CMakeLists.txt +++ b/tools/mkunity/CMakeLists.txt @@ -23,7 +23,11 @@ define_property( ) if(ICINGA2_UNITY_BUILD) - add_executable(mkunity mkunity.c) + set(mkunity_SOURCES + mkunity.c + ) + + add_executable(mkunity ${mkunity_SOURCES}) set_target_properties ( mkunity PROPERTIES