]> granicus.if.org Git - icinga2/blob - lib/compat/CMakeLists.txt
Merge pull request #6009 from Icinga/fix/build-fix-gcc
[icinga2] / lib / compat / 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 mkclass_target(checkresultreader.ti checkresultreader-ti.cpp checkresultreader-ti.hpp)
19 mkclass_target(compatlogger.ti compatlogger-ti.cpp compatlogger-ti.hpp)
20 mkclass_target(externalcommandlistener.ti externalcommandlistener-ti.cpp externalcommandlistener-ti.hpp)
21 mkclass_target(statusdatawriter.ti statusdatawriter-ti.cpp statusdatawriter-ti.hpp)
22
23 set(compat_SOURCES
24   checkresultreader.cpp checkresultreader.hpp checkresultreader-ti.hpp
25   compatlogger.cpp compatlogger.hpp compatlogger-ti.hpp
26   externalcommandlistener.cpp externalcommandlistener.hpp externalcommandlistener-ti.hpp
27   statusdatawriter.cpp statusdatawriter.hpp statusdatawriter-ti.hpp
28 )
29
30 if(ICINGA2_UNITY_BUILD)
31     mkunity_target(compat compat compat_SOURCES)
32 endif()
33
34 add_library(compat OBJECT ${compat_SOURCES})
35
36 add_dependencies(compat base config icinga)
37
38 set_target_properties (
39   compat PROPERTIES
40   FOLDER Components
41 )
42
43 install_if_not_exists(
44   ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/command.conf
45   ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
46 )
47
48 install_if_not_exists(
49   ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/compatlog.conf
50   ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
51 )
52
53 install_if_not_exists(
54   ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/statusdata.conf
55   ${CMAKE_INSTALL_SYSCONFDIR}/icinga2/features-available
56 )
57
58 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/log/icinga2/compat/archives\")")
59 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/spool/icinga2\")")
60 install(CODE "file(MAKE_DIRECTORY \"\$ENV{DESTDIR}${ICINGA2_RUNDIR}/icinga2/cmd\")")
61
62 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)