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(class_parser class_parser.yy ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc)
|
|
|
|
flex_target(class_lexer class_lexer.ll ${CMAKE_CURRENT_BINARY_DIR}/class_lexer.cc)
|
|
|
|
add_flex_bison_dependency(class_lexer class_parser)
|
|
|
|
|
2015-07-14 15:02:43 +02:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
2015-03-23 07:55:06 +01:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/class_parser.cc PROPERTY COMPILE_FLAGS "-Wno-deprecated-register")
|
2016-09-05 06:48:47 +02:00
|
|
|
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/class_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
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
|
|
|
|
2017-12-24 08:18:33 +01:00
|
|
|
set(mkclass_SOURCES
|
|
|
|
mkclass.cpp
|
|
|
|
classcompiler.cpp classcompiler.hpp
|
|
|
|
${FLEX_class_lexer_OUTPUTS}
|
|
|
|
${BISON_class_parser_OUTPUTS}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_executable(mkclass ${mkclass_SOURCES})
|
2013-11-03 13:45:26 +01:00
|
|
|
|
2014-09-10 15:24:08 +02:00
|
|
|
if(WIN32)
|
|
|
|
target_link_libraries(mkclass shlwapi)
|
|
|
|
endif()
|
|
|
|
|
2013-11-03 13:45:26 +01:00
|
|
|
set_target_properties (
|
|
|
|
mkclass PROPERTIES
|
|
|
|
FOLDER Bin
|
|
|
|
)
|
|
|
|
|
2015-03-28 11:04:42 +01:00
|
|
|
macro(MKCLASS_TARGET ClassInput ClassImplOutput ClassHeaderOutput)
|
2018-01-19 09:18:52 +01:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${ClassImplOutput} ${ClassHeaderOutput}
|
|
|
|
COMMAND mkclass
|
|
|
|
ARGS ${ClassInput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassImplOutput} ${CMAKE_CURRENT_BINARY_DIR}/${ClassHeaderOutput}
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
DEPENDS mkclass ${ClassInput}
|
|
|
|
)
|
2013-11-03 13:45:26 +01:00
|
|
|
endmacro()
|