https://github.com/Warzone2100/warzone2100/issues/2425
Above is the upstream bug report requesting CMake support for running flex
and bison. But without that we could do it ourselves.
Below is an example of CMake configuration to build with flex and bison. It
probably isn't the best way to do it but it's an example. It's probably ideal
to have some macros or something in the cmake/ directory of the source tree.
Another possibility that would be easier to write but uglier would be to have
a script run before cmake to run flex and bison.
I don't have any immediate plans to fix this but I welcome patches, either
Debian specific or patches that are suitable for sending upstream.
--- warzone2100-3.4.0.orig/lib/gamelib/CMakeLists.txt
+++ warzone2100-3.4.0/lib/gamelib/CMakeLists.txt
@@ -5,10 +5,15 @@ if(ENABLE_NLS)
find_package (Intl REQUIRED)
endif()
+find_package(FLEX)
+FLEX_TARGET(AUDP audp_lexer.lpp ${CMAKE_BINARY_DIR}/audp_lexer.cpp)
+find_package(BISON)
+BISON_TARGET(AUDP audp_parser.ypp ${CMAKE_BINARY_DIR}/audp_parser.cpp)
+
file(GLOB HEADERS "*.h")
file(GLOB SRC "*.cpp")