2 # Copyright (C) 2012-2014 Icinga Development Team (http://www.icinga.org)
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.
21 mkclass_target(idomysqlconnection.ti idomysqlconnection.thpp)
23 mkembedconfig_target(db_ido_mysql-type.conf db_ido_mysql-type.cpp)
25 set(db_ido_mysql_SOURCES
26 idomysqlconnection.cpp idomysqlconnection.thpp db_ido_mysql-type.cpp
29 if(ICINGA2_UNITY_BUILD)
30 mkunity_target(db_ido_mysql db_ido_mysql_SOURCES)
33 add_library(db_ido_mysql SHARED ${db_ido_mysql_SOURCES})
35 include_directories(${MYSQL_INCLUDE_DIR})
36 target_link_libraries(db_ido_mysql ${Boost_LIBRARIES} ${MYSQL_CLIENT_LIBS} base config icinga db_ido)
38 set_target_properties (
39 db_ido_mysql PROPERTIES
40 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
46 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
47 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
52 DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql
53 FILES_MATCHING PATTERN "*.sql"
57 DIRECTORY schema/upgrade
58 DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-mysql/schema
59 FILES_MATCHING PATTERN "*.sql"
62 message( FATAL_ERROR "You have selected MySQL support, but MySQL could not be found." )