From: Michael Wallner Date: Thu, 30 Jan 2020 18:02:09 +0000 (+0100) Subject: cmake: fix csl generation X-Git-Tag: post_cmake~25 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=aabfa542ce2721540d40bf9d53f207ec149ee6ef;p=awesomized%2Flibmemcached cmake: fix csl generation --- diff --git a/libmemcached/CMakeLists.txt b/libmemcached/CMakeLists.txt index 04b45cf5..eca34f5d 100644 --- a/libmemcached/CMakeLists.txt +++ b/libmemcached/CMakeLists.txt @@ -1,8 +1,19 @@ -add_subdirectory(csl) +find_package(FLEX) +find_package(BISON) + +bison_target(CSL_PARSER csl/parser.yy ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.cc + DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/parser.h + ) +flex_target(CSL_SCANNER csl/scanner.l ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.cc + DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/csl/scanner.h + ) +add_flex_bison_dependency(CSL_SCANNER CSL_PARSER) set(LIBMEMCACHED_SOURCES - ${CSL_SOURCES} + csl/context.cc + ${BISON_CSL_PARSER_OUTPUTS} + ${FLEX_CSL_SCANNER_OUTPUTS} allocators.cc analyze.cc array.c diff --git a/libmemcached/csl/CMakeLists.txt b/libmemcached/csl/CMakeLists.txt deleted file mode 100644 index 7b337edb..00000000 --- a/libmemcached/csl/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ - -find_package(FLEX) -find_package(BISON) - -flex_target(CSL_SCANNER scanner.l ${CMAKE_CURRENT_SOURCE_DIR}/scanner.cc - DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/scanner.h - ) -bison_target(CSL_PARSER parser.yy ${CMAKE_CURRENT_SOURCE_DIR}/parser.cc - DEFINES_FILE ${CMAKE_CURRENT_SOURCE_DIR}/parser.h - ) -add_flex_bison_dependency(CSL_SCANNER CSL_PARSER) - -set(CSL_SOURCES - csl/context.cc - ${BISON_CSL_PARSER_OUTPUTS} - ${FLEX_CSL_SCANNER_OUTPUTS} - PARENT_SCOPE)