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.
|
|
|
|
|
2013-11-03 12:40:39 +01:00
|
|
|
find_package(BISON 2.3.0 REQUIRED)
|
2013-11-21 11:22:51 +01:00
|
|
|
find_package(FLEX 2.5.31 REQUIRED)
|
2013-11-03 13:45:26 +01:00
|
|
|
|
|
|
|
bison_target(config_parser config_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc)
|
2014-09-01 09:19:21 +02:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE)
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
flex_target(config_lexer config_lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc)
|
2014-09-01 09:19:21 +02:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc PROPERTY EXCLUDE_UNITY_BUILD TRUE)
|
|
|
|
|
2015-07-14 15:02:43 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2016-09-05 06:48:47 +02:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_parser.cc PROPERTY COMPILE_FLAGS "-Wno-deprecated-register -Wno-parentheses-equality -Wno-unused-function")
|
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/config_lexer.cc PROPERTY COMPILE_FLAGS "-Wno-deprecated-register -Wno-null-conversion")
|
2015-03-23 07:55:06 +01:00
|
|
|
endif()
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
add_flex_bison_dependency(config_lexer config_parser)
|
|
|
|
|
|
|
|
include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2014-08-30 18:08:28 +02:00
|
|
|
set(config_SOURCES
|
2015-11-19 19:38:20 +01:00
|
|
|
activationcontext.cpp applyrule.cpp
|
2014-10-01 17:01:47 +02:00
|
|
|
configcompilercontext.cpp configcompiler.cpp configitembuilder.cpp
|
2013-11-03 13:45:26 +01:00
|
|
|
configitem.cpp ${FLEX_config_lexer_OUTPUTS} ${BISON_config_parser_OUTPUTS}
|
2014-11-30 23:32:13 +01:00
|
|
|
expression.cpp objectrule.cpp
|
2013-11-03 13:45:26 +01:00
|
|
|
)
|
|
|
|
|
2014-08-30 18:08:28 +02:00
|
|
|
if(ICINGA2_UNITY_BUILD)
|
2016-08-24 11:11:20 +02:00
|
|
|
mkunity_target(config config config_SOURCES)
|
2014-08-30 18:08:28 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(config SHARED ${config_SOURCES})
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
target_link_libraries(config ${Boost_LIBRARIES} base)
|
|
|
|
|
|
|
|
set_target_properties (
|
|
|
|
config PROPERTIES
|
|
|
|
INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/icinga2
|
|
|
|
DEFINE_SYMBOL I2_CONFIG_BUILD
|
|
|
|
FOLDER Lib
|
2016-08-25 17:32:20 +02:00
|
|
|
VERSION ${SPEC_VERSION}
|
2013-11-03 13:45:26 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
install(
|
|
|
|
TARGETS config
|
|
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/icinga2
|
|
|
|
)
|
2015-08-29 01:16:16 +02:00
|
|
|
|
|
|
|
if(APPLE)
|
|
|
|
install(
|
|
|
|
TARGETS config
|
|
|
|
LIBRARY DESTINATION ${CMAKE_INSTALL_BINDIR}/icinga-studio.app/Contents
|
|
|
|
)
|
|
|
|
endif()
|