]> granicus.if.org Git - icinga2/blob - lib/CMakeLists.txt
Merge pull request #5932 from Icinga/feature/copyright-header
[icinga2] / lib / CMakeLists.txt
1 # Icinga 2
2 # Copyright (C) 2012-2018 Icinga Development Team (https://www.icinga.com/)
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software Foundation
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 add_subdirectory(base)
19 add_subdirectory(cli)
20 add_subdirectory(config)
21 add_subdirectory(remote)
22 add_subdirectory(icinga)
23 add_subdirectory(methods)
24
25 if(ICINGA2_WITH_HELLO)
26   add_subdirectory(hello)
27 endif()
28
29 if(ICINGA2_WITH_CHECKER)
30   add_subdirectory(checker)
31 endif()
32
33 if(ICINGA2_WITH_COMPAT)
34   add_subdirectory(compat)
35 endif()
36
37 if(ICINGA2_WITH_MYSQL OR ICINGA2_WITH_PGSQL)
38   add_subdirectory(db_ido)
39 endif()
40
41 if(ICINGA2_WITH_MYSQL)
42   find_package(MySQL)
43
44   if(MYSQL_FOUND)
45     add_subdirectory(db_ido_mysql)
46     add_subdirectory(mysql_shim)
47   else()
48     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.")
49   endif()
50 endif()
51
52 if(ICINGA2_WITH_PGSQL)
53   find_package(PostgreSQL)
54
55   if(PostgreSQL_FOUND)
56     add_subdirectory(db_ido_pgsql)
57     add_subdirectory(pgsql_shim)
58   else()
59     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.")
60   endif()
61 endif()
62
63 if(ICINGA2_WITH_DEMO)
64   add_subdirectory(demo)
65 endif()
66
67 if(ICINGA2_WITH_LIVESTATUS)
68   add_subdirectory(livestatus)
69 endif()
70
71 if(ICINGA2_WITH_NOTIFICATION)
72   add_subdirectory(notification)
73 endif()
74
75 if(ICINGA2_WITH_PERFDATA)
76   add_subdirectory(perfdata)
77 endif()
78
79 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)