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.
18 find_package(PostgreSQL)
21 mkclass_target(idopgsqlconnection.ti idopgsqlconnection.thpp)
23 mkembedconfig_target(db_ido_pgsql-type.conf db_ido_pgsql-type.cpp)
25 link_directories(${PostgreSQL_LIBRARY_DIRS})
26 include_directories(${PostgreSQL_INCLUDE_DIRS})
28 set(db_ido_pgsql_SOURCES
29 idopgsqlconnection.cpp idopgsqlconnection.thpp db_ido_pgsql-type.cpp
32 if(ICINGA2_UNITY_BUILD)
33 mkunity_target(db_ido_pgsql db_ido_pgsql_SOURCES)
36 add_library(db_ido_pgsql SHARED ${db_ido_pgsql_SOURCES})
38 target_link_libraries(db_ido_pgsql ${Boost_LIBRARIES} ${PostgreSQL_LIBRARIES} base config icinga db_ido)
40 set_target_properties (
41 db_ido_pgsql PROPERTIES
42 INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
48 RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
49 LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
54 DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql
55 FILES_MATCHING PATTERN "*.sql"
59 DIRECTORY schema/upgrade
60 DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2-ido-pgsql/schema
61 FILES_MATCHING PATTERN "*.sql"
64 message( FATAL_ERROR "You have selected PostgreSQL support, but PostgreSQL could not be found." )