2019-02-25 15:09:36 +01:00
|
|
|
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
|
2013-11-03 13:45:26 +01:00
|
|
|
|
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
|
2017-12-24 08:18:33 +01:00
|
|
|
i2-config.hpp
|
|
|
|
activationcontext.cpp activationcontext.hpp
|
|
|
|
applyrule.cpp applyrule.hpp
|
|
|
|
configcompiler.cpp configcompiler.hpp
|
|
|
|
configcompilercontext.cpp configcompilercontext.hpp
|
|
|
|
configfragment.hpp
|
|
|
|
configitem.cpp configitem.hpp
|
|
|
|
configitembuilder.cpp configitembuilder.hpp
|
|
|
|
expression.cpp expression.hpp
|
|
|
|
objectrule.cpp objectrule.hpp
|
|
|
|
vmops.hpp
|
|
|
|
${FLEX_config_lexer_OUTPUTS} ${BISON_config_parser_OUTPUTS}
|
2013-11-03 13:45:26 +01:00
|
|
|
)
|
|
|
|
|
2014-08-30 18:08:28 +02:00
|
|
|
if(ICINGA2_UNITY_BUILD)
|
2018-01-19 09:18:52 +01:00
|
|
|
mkunity_target(config config config_SOURCES)
|
2014-08-30 18:08:28 +02:00
|
|
|
endif()
|
|
|
|
|
2018-01-17 04:28:21 +01:00
|
|
|
add_library(config OBJECT ${config_SOURCES})
|
2014-08-30 18:08:28 +02:00
|
|
|
|
2018-01-17 04:28:21 +01:00
|
|
|
add_dependencies(config base)
|
2013-11-03 13:45:26 +01:00
|
|
|
|
|
|
|
set_target_properties (
|
|
|
|
config PROPERTIES
|
|
|
|
FOLDER Lib
|
|
|
|
)
|