]> granicus.if.org Git - icinga2/blob - lib/db_ido_mysql/CMakeLists.txt
Merge pull request #6503 from peteeckel/fix/reduce-loglevel-plugin-env-6460
[icinga2] / lib / db_ido_mysql / 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(idomysqlconnection.ti idomysqlconnection-ti.cpp idomysqlconnection-ti.hpp)
19
20 set(db_ido_mysql_SOURCES
21   idomysqlconnection.cpp idomysqlconnection.hpp idomysqlconnection-ti.hpp
22 )
23
24 if(ICINGA2_UNITY_BUILD)
25   mkunity_target(db_ido_mysql db_ido_mysql db_ido_mysql_SOURCES)
26 endif()
27
28 add_library(db_ido_mysql OBJECT ${db_ido_mysql_SOURCES})
29
30 include_directories(${MYSQL_INCLUDE_DIR})
31
32 add_dependencies(db_ido_mysql base config icinga db_ido)
33
34 set_target_properties (
35   db_ido_mysql PROPERTIES
36   FOLDER Components
37 )
38
39 install_if_not_exists(
40   ${PROJECT_SOURCE_DIR}/etc/icinga2/features-available/ido-mysql.conf
41   ${ICINGA2_CONFIGDIR}/features-available
42 )
43
44 install(
45   DIRECTORY schema
46   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql
47   FILES_MATCHING PATTERN "*.sql"
48 )
49
50 install(
51   DIRECTORY schema/upgrade
52   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql/schema
53   FILES_MATCHING PATTERN "*.sql"
54 )
55
56 set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE)