Commit c83e7ee1 authored by L. E. Segovia's avatar L. E. Segovia

Automatically copy pre-generated files

This change allows SeExpr to be deployed without further changes in Windows.
parent a216d63b
......@@ -32,12 +32,19 @@ find_package(BISON)
find_package(FLEX)
find_program(SED_EXE sed)
# TODO use recent cmake to use FindFlex FindBison
if ((BISON_EXE STREQUAL "BISON_EXE-NOTFOUND") OR
(FLEX_EXE STREQUAL "FLEX_EXE-NOTFOUND") OR
if (NOT BISON_FOUND OR
NOT FLEX_FOUND OR
(SED_EXE STREQUAL "SED_EXE-NOTFOUND"))
# don't have flex/bison/sed, use pregenerated versions
set(parser_cpp generated/ExprParser.cpp generated/ExprParserLex.cpp)
message(STATUS "Using pregenerated parser files")
file(COPY ${CMAKE_SOURCE_DIR}/windows7/SeExpr/generated/
DESTINATION .
USE_SOURCE_PERMISSIONS)
file(COPY ${CMAKE_SOURCE_DIR}/windows7/SeExpr/UI/generated/
DESTINATION UI
USE_SOURCE_PERMISSIONS)
set(parser_cpp ExprParser.cpp ExprParserLex.cpp)
else()
## build the parser from the flex/yacc sources
add_custom_command(
......
......@@ -7,7 +7,8 @@ macro(BuildParserScanner FLEX_L_PREFIX BISON_Y_PREFIX PARSER_PREFIX GENERATED_CP
if((BISON_EXE STREQUAL "BISON_EXE-NOTFOUND") OR (FLEX_EXE STREQUAL "FLEX_EXE-NOTFOUND") OR (SED_EXE STREQUAL "SED_EXE-NOTFOUND"))
# don't have flex/bison/sed, use pregenerated versions
set (${GENERATED_CPPS} generated/${BISON_Y_PREFIX}.cpp generated/${FLEX_L_PREFIX}.cpp )
# they should have been copied in the SeExpr2 project
set (${GENERATED_CPPS} ${FLEX_L_PREFIX}.cpp ${BISON_Y_PREFIX}.cpp)
else ((BISON_EXE STREQUAL "BISON_EXE-NOTFOUND") OR (FLEX_EXE STREQUAL "FLEX_EXE-NOTFOUND") OR (SED_EXE STREQUAL "SED_EXE-NOTFOUND"))
## build the parser from the flex/yacc sources
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment