2013-11-03 13:45:26 +01:00
# Icinga 2
2014-03-19 01:02:29 +01:00
# Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
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 )
2014-12-19 09:45:35 +01:00
mkclass_target ( idomysqlconnection.ti idomysqlconnection.thpp )
mkembedconfig_target ( db_ido_mysql-type.conf db_ido_mysql-type.cpp )
set ( db_ido_mysql_SOURCES
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 d b _ i d o _ m y s q l - t y p e . c p p
)
if ( ICINGA2_UNITY_BUILD )
mkunity_target ( db_ido_mysql db_ido_mysql_SOURCES )
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
F O L D E R C o m p o n e n t s
)
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 "
)
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 ( )