]> granicus.if.org Git - icinga2/blobdiff - lib/CMakeLists.txt
ApiListener#ApiTimerHandler(): delete all replayed logs
[icinga2] / lib / CMakeLists.txt
index 7504c605ad51d2ecd26b4c9926ea1baa10e98b57..8c0fe2cfb322fc04c8888f729efee07dec719cf3 100644 (file)
@@ -1,5 +1,5 @@
 # Icinga 2
-# Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
+# Copyright (C) 2012-2018 Icinga Development Team (https://icinga.com/)
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
 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_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)
+  find_package(MySQL)
+
+  if(MYSQL_FOUND)
+    add_subdirectory(db_ido_mysql)
+    add_subdirectory(mysql_shim)
+  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.")
+  endif()
 endif()
 
 if(ICINGA2_WITH_PGSQL)
-       add_subdirectory(db_ido_pgsql)
+  find_package(PostgreSQL)
+
+  if(PostgreSQL_FOUND)
+    add_subdirectory(db_ido_pgsql)
+    add_subdirectory(pgsql_shim)
+  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.")
+  endif()
+endif()
+
+if(ICINGA2_WITH_LIVESTATUS)
+  add_subdirectory(livestatus)
+endif()
+
+if(ICINGA2_WITH_NOTIFICATION)
+  add_subdirectory(notification)
+endif()
+
+if(ICINGA2_WITH_PERFDATA)
+  add_subdirectory(perfdata)
 endif()
 
-add_subdirectory(demo)
-add_subdirectory(livestatus)
-add_subdirectory(notification)
-add_subdirectory(perfdata)
+set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)