]> granicus.if.org Git - icinga2/commitdiff
Implement CMake options for some of the modules
authorGunnar Beutner <gunnar@beutner.name>
Fri, 19 Dec 2014 08:45:35 +0000 (09:45 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Fri, 19 Dec 2014 08:46:41 +0000 (09:46 +0100)
fixes #7794
fixes #7795

14 files changed:
CMakeLists.txt
INSTALL.md
etc/CMakeLists.txt
lib/CMakeLists.txt
lib/base/CMakeLists.txt
lib/checker/CMakeLists.txt
lib/compat/CMakeLists.txt
lib/db_ido_mysql/CMakeLists.txt
lib/db_ido_pgsql/CMakeLists.txt
lib/demo/CMakeLists.txt
lib/hello/CMakeLists.txt
lib/livestatus/CMakeLists.txt
lib/notification/CMakeLists.txt
lib/perfdata/CMakeLists.txt

index e5dc0d5cf4aaade9029ca68186ddd0c42276bc96..7d117c36c3b49d1299495c7077755ab5f21ee063 100644 (file)
@@ -28,8 +28,15 @@ if(NOT CMAKE_BUILD_TYPE)
       FORCE)
 endif()
 
-option(ICINGA2_WITH_MYSQL "MySQL support" ON)
-option(ICINGA2_WITH_PGSQL "PostgreSQL support" ON)
+option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
+option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
+option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
+option(ICINGA2_WITH_COMPAT "Build the compat module" ON)
+option(ICINGA2_WITH_DEMO "Build the demo module" OFF)
+option(ICINGA2_WITH_HELLO "Build the hello module" OFF)
+option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON)
+option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON)
+option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON)
 
 file(STRINGS icinga2.spec VERSION_LINE REGEX "^Version: ")
 string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE})
index fd68a736deb2d3b5a04189f7de2675103062de01..f043bd80058b24f26d97ad6829c341240a2ab6e3 100644 (file)
@@ -157,6 +157,13 @@ Only use this for special packaging purposes and if you know what you are doing.
 Defaults to `OFF`.
 - `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON`
 - `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON`
+- `ICINGA2_WITH_CHECKER`: Determines whether the checker module is built; defaults to `ON`
+- `ICINGA2_WITH_COMPAT`: Determines whether the compat module is built; defaults to `ON`
+- `ICINGA2_WITH_DEMO`: Determines whether the demo module is built; defaults to `OFF`
+- `ICINGA2_WITH_HELLO`: Determines whether the hello module is built; defaults to `OFF`
+- `ICINGA2_WITH_LIVESTATUS`: Determines whether the Livestatus module is built; defaults to `ON`
+- `ICINGA2_WITH_NOTIFICATION`: Determines whether the notification module is built; defaults to `ON`
+- `ICINGA2_WITH_PERFDATA`: Determines whether the perfdata module is built; defaults to `ON`
 
 ### Building Icinga 2 RPMs
 
index 05dd88afb6a04da4973e14fc966aa2782823cf4a..1544828ff10160c21d5d7c390967fb25e8d0479a 100644 (file)
@@ -55,20 +55,9 @@ install_if_not_exists(icinga2/conf.d/templates.conf ${CMAKE_INSTALL_SYSCONFDIR}/
 install_if_not_exists(icinga2/conf.d/timeperiods.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
 install_if_not_exists(icinga2/conf.d/users.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/conf.d)
 install_if_not_exists(icinga2/features-available/api.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/checker.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/command.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/compatlog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
 install_if_not_exists(icinga2/features-available/debuglog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/gelf.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/graphite.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
 install_if_not_exists(icinga2/features-available/icingastatus.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/ido-mysql.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/ido-pgsql.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/livestatus.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
 install_if_not_exists(icinga2/features-available/mainlog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/notification.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/perfdata.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
-install_if_not_exists(icinga2/features-available/statusdata.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
 install_if_not_exists(icinga2/features-available/syslog.conf ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available)
 install_if_not_exists(icinga2/scripts/mail-host-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
 install_if_not_exists(icinga2/scripts/mail-service-notification.sh ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/scripts)
@@ -84,8 +73,6 @@ install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDI
 
 if(NOT WIN32)
   install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled\")")
-  install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/checker.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/checker.conf\")")
-  install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/notification.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/notification.conf\")")
   install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/mainlog.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/mainlog.conf\")")
 
   install(
@@ -94,8 +81,7 @@ if(NOT WIN32)
   )
 else()
   install(
-    FILES icinga2/features-enabled/checker.conf icinga2/features-enabled/notification.conf
-          icinga2/features-enabled/mainlog.conf
+    FILES icinga2/features-enabled/mainlog.conf
     DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled
   )
 endif()
index 7504c605ad51d2ecd26b4c9926ea1baa10e98b57..8fca4d501c7c582a1f8535e7503f02cbfe7daf9d 100644 (file)
 add_subdirectory(base)
 add_subdirectory(cli)
 add_subdirectory(config)
+add_subdirectory(remote)
 add_subdirectory(icinga)
-add_subdirectory(db_ido)
 add_subdirectory(methods)
-add_subdirectory(hello)
-add_subdirectory(remote)
-add_subdirectory(checker)
-add_subdirectory(compat)
+
+if(ICINGA2_WITH_HELLO)
+  add_subdirectory(hello)
+endif()
+
+if(ICINGA2_WITH_CHECKER)
+  add_subdirectory(checker)
+endif()
+
+if(ICINGA2_WITH_COMPAT)
+  add_subdirectory(compat)
+endif()
+
+if(ICINGA2_WITH_MYSQL OR ICINGA2_WITH_PGSQL)
+  add_subdirectory(db_ido)
+endif()
 
 if(ICINGA2_WITH_MYSQL)
-       add_subdirectory(db_ido_mysql)
+  add_subdirectory(db_ido_mysql)
 endif()
 
 if(ICINGA2_WITH_PGSQL)
-       add_subdirectory(db_ido_pgsql)
+  add_subdirectory(db_ido_pgsql)
+endif()
+
+if(ICINGA2_WITH_DEMO)
+  add_subdirectory(demo)
+endif()
+
+if(ICINGA2_WITH_LIVESTATUS)
+  add_subdirectory(livestatus)
+endif()
+
+if(ICINGA2_WITH_NOTIFICATION)
+  add_subdirectory(notification)
 endif()
 
-add_subdirectory(demo)
-add_subdirectory(livestatus)
-add_subdirectory(notification)
-add_subdirectory(perfdata)
+if(ICINGA2_WITH_PERFDATA)
+  add_subdirectory(perfdata)
+endif()
index 87b5f10b03427035e2d072d78acc36f4f0ae49e3..376f8ab27ca9eb10c3e5c9942591c1602ae1ad03 100644 (file)
@@ -70,6 +70,8 @@ set_target_properties (
   FOLDER Lib
 )
 
+install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/icinga2\")")
+
 install(
   TARGETS base
   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
index 2c60df7510d713df297b5a0be404864ffe8ada97..a01c8ed38db9b48d73bd405600e61f4d11579596 100644 (file)
@@ -37,9 +37,23 @@ set_target_properties (
   FOLDER Components
 )
 
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/checker.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+if(NOT WIN32)
+  install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled\")")
+  install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/checker.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/checker.conf\")")
+else()
+  install(
+    FILES ${PROJECT_SOURCE_DIR}/etc/icinga2/features-enabled/checker.conf
+    DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled
+  )
+endif()
+
 install(
   TARGETS checker
   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
 )
-
index ad7f9ec8aea6b5eb0abdb0cd3ff0b0e47d2d2485..b88339ef7c89009cc2bc94573e55ee598a9f2a4f 100644 (file)
@@ -42,10 +42,24 @@ set_target_properties (
   FOLDER Components
 )
 
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/command.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/compatlog.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/statusdata.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
 install(TARGETS compat RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
 
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/compat/archives\")")
-install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/cache/icinga2\")")
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2\")")
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2/cmd\")")
 
index 1856ca89085e4c70b9b93cfc5427bf52d0acd0e2..e874738a9c0f762e7bf721d346d8fe22bd72180a 100644 (file)
 find_package(MySQL)
 
 if(MYSQL_FOUND)
-    mkclass_target(idomysqlconnection.ti idomysqlconnection.thpp)
-
-    mkembedconfig_target(db_ido_mysql-type.conf db_ido_mysql-type.cpp)
-
-    set(db_ido_mysql_SOURCES
-      idomysqlconnection.cpp idomysqlconnection.thpp db_ido_mysql-type.cpp
-    )
-
-    if(ICINGA2_UNITY_BUILD)
-        mkunity_target(db_ido_mysql db_ido_mysql_SOURCES)
-    endif()
-
-    add_library(db_ido_mysql SHARED ${db_ido_mysql_SOURCES})
-
-    include_directories(${MYSQL_INCLUDE_DIR})
-    target_link_libraries(db_ido_mysql ${Boost_LIBRARIES} ${MYSQL_CLIENT_LIBS} base config icinga db_ido)
-
-    set_target_properties (
-      db_ido_mysql PROPERTIES
-      INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
-      FOLDER Components
-    )
-
-    install(
-      TARGETS db_ido_mysql
-      RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
-      LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
-    )
-
-    install(
-      DIRECTORY schema
-      DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql
-      FILES_MATCHING PATTERN "*.sql"
-    )
-
-    install(
-      DIRECTORY schema/upgrade
-      DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql/schema
-      FILES_MATCHING PATTERN "*.sql"
-    )
+  mkclass_target(idomysqlconnection.ti idomysqlconnection.thpp)
+
+  mkembedconfig_target(db_ido_mysql-type.conf db_ido_mysql-type.cpp)
+
+  set(db_ido_mysql_SOURCES
+    idomysqlconnection.cpp idomysqlconnection.thpp db_ido_mysql-type.cpp
+  )
+
+  if(ICINGA2_UNITY_BUILD)
+      mkunity_target(db_ido_mysql db_ido_mysql_SOURCES)
+  endif()
+
+  add_library(db_ido_mysql SHARED ${db_ido_mysql_SOURCES})
+
+  include_directories(${MYSQL_INCLUDE_DIR})
+  target_link_libraries(db_ido_mysql ${Boost_LIBRARIES} ${MYSQL_CLIENT_LIBS} base config icinga db_ido)
+
+  set_target_properties (
+    db_ido_mysql PROPERTIES
+    INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+    FOLDER Components
+  )
+
+  install_if_not_exists(
+    ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/ido-mysql.conf
+    ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+  )
+
+  install(
+    TARGETS db_ido_mysql
+    RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+  )
+
+  install(
+    DIRECTORY schema
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql
+    FILES_MATCHING PATTERN "*.sql"
+  )
+
+  install(
+    DIRECTORY schema/upgrade
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql/schema
+    FILES_MATCHING PATTERN "*.sql"
+  )
 else()
-    message(FATAL_ERROR "You have selected MySQL support, but MySQL could not be found. You can disable the MySQL IDO module using -DICINGA2_WITH_MYSQL=OFF.")
+  message(FATAL_ERROR "You have selected MySQL support, but MySQL could not be found. You can disable the MySQL IDO module using -DICINGA2_WITH_MYSQL=OFF.")
 endif()
index 3a9a9bcfe342488c1b56fdc47e9dbf639e47b23c..99fde0009cb7b9ea3318516aca6d13d6537511c8 100644 (file)
 find_package(PostgreSQL)
 
 if(PostgreSQL_FOUND)
-    mkclass_target(idopgsqlconnection.ti idopgsqlconnection.thpp)
+  mkclass_target(idopgsqlconnection.ti idopgsqlconnection.thpp)
 
-    mkembedconfig_target(db_ido_pgsql-type.conf db_ido_pgsql-type.cpp)
+  mkembedconfig_target(db_ido_pgsql-type.conf db_ido_pgsql-type.cpp)
 
-    link_directories(${PostgreSQL_LIBRARY_DIRS})
-    include_directories(${PostgreSQL_INCLUDE_DIRS})
+  link_directories(${PostgreSQL_LIBRARY_DIRS})
+  include_directories(${PostgreSQL_INCLUDE_DIRS})
 
-    set(db_ido_pgsql_SOURCES
-      idopgsqlconnection.cpp idopgsqlconnection.thpp db_ido_pgsql-type.cpp
-    )
+  set(db_ido_pgsql_SOURCES
+    idopgsqlconnection.cpp idopgsqlconnection.thpp db_ido_pgsql-type.cpp
+  )
 
-    if(ICINGA2_UNITY_BUILD)
-        mkunity_target(db_ido_pgsql db_ido_pgsql_SOURCES)
-    endif()
+  if(ICINGA2_UNITY_BUILD)
+      mkunity_target(db_ido_pgsql db_ido_pgsql_SOURCES)
+  endif()
 
-    add_library(db_ido_pgsql SHARED ${db_ido_pgsql_SOURCES})
+  add_library(db_ido_pgsql SHARED ${db_ido_pgsql_SOURCES})
 
-    target_link_libraries(db_ido_pgsql ${Boost_LIBRARIES} ${PostgreSQL_LIBRARIES} base config icinga db_ido)
+  target_link_libraries(db_ido_pgsql ${Boost_LIBRARIES} ${PostgreSQL_LIBRARIES} base config icinga db_ido)
 
-    set_target_properties (
-      db_ido_pgsql PROPERTIES
-      INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
-      FOLDER Components
-    )
+  set_target_properties (
+    db_ido_pgsql PROPERTIES
+    INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+    FOLDER Components
+  )
 
-    install(
-      TARGETS db_ido_pgsql
-      RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
-      LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
-    )
+  install_if_not_exists(
+    ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/ido-pgsql.conf
+    ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+  )
 
-    install(
-      DIRECTORY schema
-      DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql
-      FILES_MATCHING PATTERN "*.sql"
-    )
+  install(
+    TARGETS db_ido_pgsql
+    RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
+    LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
+  )
 
-    install(
-      DIRECTORY schema/upgrade
-      DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql/schema
-      FILES_MATCHING PATTERN "*.sql"
-    )
+  install(
+    DIRECTORY schema
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql
+    FILES_MATCHING PATTERN "*.sql"
+  )
+
+  install(
+    DIRECTORY schema/upgrade
+    DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql/schema
+    FILES_MATCHING PATTERN "*.sql"
+  )
 else()
-    message(FATAL_ERROR "You have selected PostgreSQL support, but PostgreSQL could not be found. You can disable the PostgreSQL IDO module using -DICINGA2_WITH_PGSQL=OFF.")
+  message(FATAL_ERROR "You have selected PostgreSQL support, but PostgreSQL could not be found. You can disable the PostgreSQL IDO module using -DICINGA2_WITH_PGSQL=OFF.")
 endif()
index ac926c9d02366a92b2577e5b2a711a23382ba252..6a208b7a3e0edad8e20079d8d9a203cbf6f4ea48 100644 (file)
@@ -42,3 +42,4 @@ install(
   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
 )
+
index ea1244a47ee8312eeb29abe670c9c539f2f7fb44..f4f9297916a9c3d871b1f16ff020f369332d99f5 100644 (file)
@@ -42,3 +42,4 @@ install(
   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
   LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
 )
+
index 38b5915fb00ca645be56cd9a62a71f248e3f26c0..ac9b9e6399ee1e7d34d2d179a65aa74929670465 100644 (file)
@@ -47,4 +47,10 @@ set_target_properties (
   FOLDER Components
 )
 
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/livestatus.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
 install(TARGETS livestatus RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
+
index 8da77f79d5bdefc1d719e2f97ad18a20dd5a6736..1437119d61be6653b2e52f9ce1d75eca278199d9 100644 (file)
@@ -37,4 +37,20 @@ set_target_properties (
   FOLDER Components
 )
 
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/notification.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+if(NOT WIN32)
+  install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled\")")
+  install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink ../features-available/notification.conf \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_SYSCONFDIR}/icinga2/features-enabled/notification.conf\")")
+else()
+  install(
+    FILES ${PROJECT_SOURCE_DIR}/etc/icinga2/features-enabled/notification.conf
+    DESTINATION ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-enabled
+  )
+endif()
+
 install(TARGETS notification RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2)
+
index 6a57e755991e88605869d7dfe3bfed97464ac3bb..62146bff1aadd12954c72997f155f3532891b761 100644 (file)
@@ -39,6 +39,21 @@ set_target_properties (
   FOLDER Components
 )
 
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/gelf.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/graphite.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
+install_if_not_exists(
+  ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/perfdata.conf
+  ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
+)
+
 install(
   TARGETS perfdata
   RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
@@ -47,3 +62,4 @@ install(
 
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/perfdata\")")
 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2/tmp\")")
+