2010-11-12 15:14:25 +05:30
|
|
|
project (ndhc)
|
|
|
|
|
|
|
|
cmake_minimum_required (VERSION 2.6)
|
|
|
|
|
2014-03-10 10:22:56 +05:30
|
|
|
include_directories("${PROJECT_SOURCE_DIR}")
|
|
|
|
|
|
|
|
set(RAGEL_IFCHD_PARSE ${CMAKE_CURRENT_BINARY_DIR}/ifchd-parse.c)
|
2014-04-15 00:36:31 +05:30
|
|
|
set(RAGEL_CFG_PARSE ${CMAKE_CURRENT_BINARY_DIR}/cfg.c)
|
2014-03-10 10:22:56 +05:30
|
|
|
|
|
|
|
find_program(RAGEL ragel)
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${RAGEL_IFCHD_PARSE}
|
|
|
|
COMMAND ${RAGEL} -G2 -o ${RAGEL_IFCHD_PARSE} ifchd-parse.rl
|
|
|
|
DEPENDS ifchd-parse.rl
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
COMMENT "Compiling Ragel state machine: ifchd-parse.rl"
|
|
|
|
VERBATIM
|
|
|
|
)
|
2014-04-15 00:36:31 +05:30
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${RAGEL_CFG_PARSE}
|
|
|
|
COMMAND ${RAGEL} -G2 -o ${RAGEL_CFG_PARSE} cfg.rl
|
|
|
|
DEPENDS cfg.rl
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
COMMENT "Compiling Ragel state machine: cfg.rl"
|
|
|
|
VERBATIM
|
|
|
|
)
|
2014-03-10 10:22:56 +05:30
|
|
|
|
2011-04-20 02:07:43 +05:30
|
|
|
file(GLOB NDHC_SRCS "*.c")
|
2010-11-12 15:14:25 +05:30
|
|
|
|
2014-04-15 00:36:31 +05:30
|
|
|
add_executable(ndhc ${RAGEL_CFG_PARSE} ${RAGEL_IFCHD_PARSE} ${NDHC_SRCS})
|
2011-07-04 03:00:55 +05:30
|
|
|
target_link_libraries(ndhc ncmlib)
|