2013-11-03 13:45:26 +01:00
# Icinga 2
2017-01-10 15:54:22 +01:00
# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
2013-11-03 13:45:26 +01:00
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
2014-06-25 10:21:38 +02:00
find_package ( MySQL )
2013-11-03 13:45:26 +01:00
if ( MYSQL_FOUND )
2015-03-28 11:04:42 +01:00
mkclass_target ( idomysqlconnection.ti idomysqlconnection.tcpp idomysqlconnection.thpp )
2014-12-19 09:45:35 +01:00
set ( db_ido_mysql_SOURCES
2014-11-30 23:32:13 +01:00
i d o m y s q l c o n n e c t i o n . c p p i d o m y s q l c o n n e c t i o n . t h p p
2014-12-19 09:45:35 +01:00
)
if ( ICINGA2_UNITY_BUILD )
2016-08-24 11:11:20 +02:00
mkunity_target ( db_ido_mysql db_ido_mysql db_ido_mysql_SOURCES )
2014-12-19 09:45:35 +01:00
endif ( )
add_library ( db_ido_mysql SHARED ${ db_ido_mysql_SOURCES } )
include_directories ( ${ MYSQL_INCLUDE_DIR } )
target_link_libraries ( db_ido_mysql ${ Boost_LIBRARIES } ${ MYSQL_CLIENT_LIBS } base config icinga db_ido )
set_target_properties (
d b _ i d o _ m y s q l P R O P E R T I E S
I N S T A L L _ R P A T H $ { C M A K E _ I N S T A L L _ F U L L _ L I B D I R } / i c i n g a 2
2015-08-04 14:47:44 +02:00
D E F I N E _ S Y M B O L I 2 _ D B _ I D O _ M Y S Q L _ B U I L D
2014-12-19 09:45:35 +01:00
F O L D E R C o m p o n e n t s
2016-08-25 17:32:20 +02:00
V E R S I O N $ { S P E C _ V E R S I O N }
2014-12-19 09:45:35 +01:00
)
install_if_not_exists (
$ { P R O J E C T _ S O U R C E _ D I R } / e t c / i c i n g a 2 / f e a t u r e s - a v a i l a b l e / i d o - m y s q l . c o n f
$ { C M A K E _ I N S T A L L _ S Y S C O N F D I R } / i c i n g a 2 / f e a t u r e s - a v a i l a b l e
)
install (
T A R G E T S d b _ i d o _ m y s q l
R U N T I M E D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ S B I N D I R }
L I B R A R Y D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ F U L L _ L I B D I R } / i c i n g a 2
)
install (
D I R E C T O R Y s c h e m a
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ D A T A D I R } / i c i n g a 2 - i d o - m y s q l
F I L E S _ M A T C H I N G P A T T E R N " * . s q l "
)
install (
D I R E C T O R Y s c h e m a / u p g r a d e
D E S T I N A T I O N $ { C M A K E _ I N S T A L L _ D A T A D I R } / i c i n g a 2 - i d o - m y s q l / s c h e m a
F I L E S _ M A T C H I N G P A T T E R N " * . s q l "
)
2015-02-02 09:58:38 +01:00
set ( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "${CPACK_NSIS_EXTRA_INSTALL_COMMANDS}" PARENT_SCOPE )
2014-11-13 22:37:12 +01:00
else ( )
2014-12-19 09:45:35 +01:00
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." )
2013-11-03 13:45:26 +01:00
endif ( )