2 # Copyright (C) 2012-2018 Icinga Development Team (https://icinga.com/)
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.
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.
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.
19 set(WindowsSources icinga.rc)
21 set(WindowsSources "")
24 set(icingaloader_SOURCES
29 add_library(icingaloader OBJECT ${icingaloader_SOURCES})
30 add_dependencies(icingaloader base config cli)
32 set_target_properties (
33 icingaloader PROPERTIES
37 include_directories(${Boost_INCLUDE_DIRS})
39 if(ICINGA2_WITH_CHECKER)
40 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:checker>)
43 if(ICINGA2_WITH_COMPAT)
44 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:compat>)
47 if(ICINGA2_WITH_MYSQL OR ICINGA2_WITH_PGSQL)
48 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:db_ido>)
51 if(ICINGA2_WITH_MYSQL)
52 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:db_ido_mysql>)
55 if(ICINGA2_WITH_PGSQL)
56 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:db_ido_pgsql>)
59 if(ICINGA2_WITH_LIVESTATUS)
60 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:livestatus>)
63 if(ICINGA2_WITH_NOTIFICATION)
64 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:notification>)
67 if(ICINGA2_WITH_PERFDATA)
68 list(APPEND icinga_app_SOURCES $<TARGET_OBJECTS:perfdata>)
71 add_executable(icinga-app
72 $<TARGET_OBJECTS:icingaloader>
74 $<TARGET_OBJECTS:config>
75 $<TARGET_OBJECTS:remote>
77 $<TARGET_OBJECTS:icinga>
78 $<TARGET_OBJECTS:methods>
82 target_link_libraries(icinga-app ${base_DEPS})
84 set_target_properties (
86 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
92 set(InstallPath "${CMAKE_INSTALL_SBINDIR}")
94 configure_file(icinga2.cmake ${CMAKE_CURRENT_BINARY_DIR}/icinga2 @ONLY)
97 FILES ${CMAKE_CURRENT_BINARY_DIR}/icinga2
98 DESTINATION ${CMAKE_INSTALL_SBINDIR}
99 PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
102 set(InstallPath "${CMAKE_INSTALL_LIBDIR}/icinga2/sbin")
107 RUNTIME DESTINATION ${InstallPath}
110 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_LOGDIR}\")")
111 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_DATADIR}\")")
112 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_FULL_INITRUNDIR}\")")