2013-10-30 15:32:33 +01:00
# Icinga 2
2017-01-10 15:54:22 +01:00
# Copyright (C) 2012-2017 Icinga Development Team (https://www.icinga.com/)
2013-10-30 15:32:33 +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.
find_package ( PostgreSQL )
if ( PostgreSQL_FOUND )
2015-03-28 11:04:42 +01:00
mkclass_target ( idopgsqlconnection.ti idopgsqlconnection.tcpp idopgsqlconnection.thpp )
2013-10-30 15:32:33 +01:00
2014-12-19 09:45:35 +01:00
link_directories ( ${ PostgreSQL_LIBRARY_DIRS } )
include_directories ( ${ PostgreSQL_INCLUDE_DIRS } )
2013-11-12 23:48:28 +01:00
2014-12-19 09:45:35 +01:00
set ( db_ido_pgsql_SOURCES
2014-11-30 23:32:13 +01:00
i d o p g s q l c o n n e c t i o n . c p p i d o p g 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
)
2014-08-30 18:08:28 +02:00
2014-12-19 09:45:35 +01:00
if ( ICINGA2_UNITY_BUILD )
2016-08-24 11:11:20 +02:00
mkunity_target ( db_ido_pgsql db_ido_pgsql db_ido_pgsql_SOURCES )
2014-12-19 09:45:35 +01:00
endif ( )
2014-08-30 18:08:28 +02:00
2014-12-19 09:45:35 +01:00
add_library ( db_ido_pgsql SHARED ${ db_ido_pgsql_SOURCES } )
2013-10-30 15:32:33 +01:00
2014-12-19 09:45:35 +01:00
target_link_libraries ( db_ido_pgsql ${ Boost_LIBRARIES } ${ PostgreSQL_LIBRARIES } base config icinga db_ido )
2013-10-30 15:32:33 +01:00
2014-12-19 09:45:35 +01:00
set_target_properties (
d b _ i d o _ p g 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 _ P G 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
)
2013-10-30 15:32:33 +01:00
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 - p g 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
)
2014-08-17 13:20:39 +02:00
2014-12-19 09:45:35 +01:00
install (
T A R G E T S d b _ i d o _ p g 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
)
2014-08-17 13:20:39 +02:00
2014-12-19 09:45:35 +01:00
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 - p g 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 - p g 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 PostgreSQL support, but PostgreSQL could not be found. You can disable the PostgreSQL IDO module using -DICINGA2_WITH_PGSQL=OFF." )
2013-10-30 15:32:33 +01:00
endif ( )