diff options
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 103 |
1 files changed, 71 insertions, 32 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7233052..029b613 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -100,25 +100,39 @@ add_custom_command( ) set_source_files_properties(${GENERATED_SRC}/layout_default.xml.h PROPERTIES GENERATED 1) -# Targets for flex/bison generated files -FLEX_TARGET(scanner scanner.l ${GENERATED_SRC}/scanner.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(code code.l ${GENERATED_SRC}/code.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(pyscanner pyscanner.l ${GENERATED_SRC}/pyscanner.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(pycode pycode.l ${GENERATED_SRC}/pycode.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(fortranscanner fortranscanner.l ${GENERATED_SRC}/fortranscanner.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(fortrancode fortrancode.l ${GENERATED_SRC}/fortrancode.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(vhdlcode vhdlcode.l ${GENERATED_SRC}/vhdlcode.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(tclscanner tclscanner.l ${GENERATED_SRC}/tclscanner.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(pre pre.l ${GENERATED_SRC}/pre.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(declinfo declinfo.l ${GENERATED_SRC}/declinfo.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(defargs defargs.l ${GENERATED_SRC}/defargs.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(doctokenizer doctokenizer.l ${GENERATED_SRC}/doctokenizer.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(commentcnv commentcnv.l ${GENERATED_SRC}/commentcnv.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(commentscan commentscan.l ${GENERATED_SRC}/commentscan.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(constexp constexp.l ${GENERATED_SRC}/constexp.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(xmlcode xmlcode.l ${GENERATED_SRC}/xmlcode.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(sqlcode sqlcode.l ${GENERATED_SRC}/sqlcode.cpp COMPILE_FLAGS "${LEX_FLAGS}") -FLEX_TARGET(configimpl configimpl.l ${GENERATED_SRC}/configimpl.cpp COMPILE_FLAGS "${LEX_FLAGS}") +set(LEX_FILES scanner + code + pyscanner + pycode + fortranscanner + fortrancode + vhdlcode + tclscanner + pre + declinfo + defargs + doctokenizer + commentcnv + commentscan + constexp + xmlcode + sqlcode + configimpl) + +# unfortunately ${LEX_FILES_H} and ${LEX_FILES_CPP} don't work in older versions of CMake (like 3.6.2) for add_library +foreach(lex_file ${LEX_FILES}) + set(LEX_FILES_H ${LEX_FILES_H} " " ${GENERATED_SRC}/${lex_file}.l.h CACHE INTERNAL "Stores generated files") + set(LEX_FILES_CPP ${LEX_FILES_CPP} " " ${GENERATED_SRC}/${lex_file}.cpp CACHE INTERNAL "Stores generated files") + add_custom_command( + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l > ${GENERATED_SRC}/${lex_file}.l.h + DEPENDS ${CMAKE_SOURCE_DIR}/src/scan_states.py ${CMAKE_SOURCE_DIR}/src/${lex_file}.l + OUTPUT ${GENERATED_SRC}/${lex_file}.l.h + ) + set_source_files_properties(${GENERATED_SRC}/${lex_file}.l.h PROPERTIES GENERATED 1) + + FLEX_TARGET(${lex_file} ${lex_file}.l ${GENERATED_SRC}/${lex_file}.cpp COMPILE_FLAGS "${LEX_FLAGS}") +endforeach() + BISON_TARGET(constexp constexp.y ${GENERATED_SRC}/ce_parse.cpp COMPILE_FLAGS "${YACC_FLAGS}") @@ -140,24 +154,45 @@ add_library(_doxygen STATIC ${GENERATED_SRC}/ce_parse.h ${GENERATED_SRC}/configvalues.h ${GENERATED_SRC}/resources.cpp - # generated by flex/bison - ${GENERATED_SRC}/scanner.cpp + # generated for/by flex/bison + #${LEX_FILES_H} #unfortunately doesn't work in older versions of CMake (like 3.6.2) + #${LEX_FILES_CPP} #unfortunately doesn't work in older versions of CMake (like 3.6.2) + ${GENERATED_SRC}/code.l.h + ${GENERATED_SRC}/commentcnv.l.h + ${GENERATED_SRC}/commentscan.l.h + ${GENERATED_SRC}/configimpl.l.h + ${GENERATED_SRC}/constexp.l.h + ${GENERATED_SRC}/declinfo.l.h + ${GENERATED_SRC}/defargs.l.h + ${GENERATED_SRC}/doctokenizer.l.h + ${GENERATED_SRC}/fortrancode.l.h + ${GENERATED_SRC}/fortranscanner.l.h + ${GENERATED_SRC}/pre.l.h + ${GENERATED_SRC}/pycode.l.h + ${GENERATED_SRC}/pyscanner.l.h + ${GENERATED_SRC}/scanner.l.h + ${GENERATED_SRC}/sqlcode.l.h + ${GENERATED_SRC}/tclscanner.l.h + ${GENERATED_SRC}/vhdlcode.l.h + ${GENERATED_SRC}/xmlcode.l.h ${GENERATED_SRC}/code.cpp - ${GENERATED_SRC}/pyscanner.cpp - ${GENERATED_SRC}/pycode.cpp - ${GENERATED_SRC}/fortranscanner.cpp - ${GENERATED_SRC}/fortrancode.cpp - ${GENERATED_SRC}/vhdlcode.cpp - ${GENERATED_SRC}/tclscanner.cpp - ${GENERATED_SRC}/pre.cpp - ${GENERATED_SRC}/declinfo.cpp - ${GENERATED_SRC}/defargs.cpp - ${GENERATED_SRC}/doctokenizer.cpp ${GENERATED_SRC}/commentcnv.cpp ${GENERATED_SRC}/commentscan.cpp + ${GENERATED_SRC}/configimpl.cpp ${GENERATED_SRC}/constexp.cpp - ${GENERATED_SRC}/xmlcode.cpp + ${GENERATED_SRC}/declinfo.cpp + ${GENERATED_SRC}/defargs.cpp + ${GENERATED_SRC}/doctokenizer.cpp + ${GENERATED_SRC}/fortrancode.cpp + ${GENERATED_SRC}/fortranscanner.cpp + ${GENERATED_SRC}/pre.cpp + ${GENERATED_SRC}/pycode.cpp + ${GENERATED_SRC}/pyscanner.cpp + ${GENERATED_SRC}/scanner.cpp ${GENERATED_SRC}/sqlcode.cpp + ${GENERATED_SRC}/tclscanner.cpp + ${GENERATED_SRC}/vhdlcode.cpp + ${GENERATED_SRC}/xmlcode.cpp # ${GENERATED_SRC}/ce_parse.cpp # @@ -251,6 +286,10 @@ add_library(_doxygen STATIC docgroup.cpp ) +##foreach(lex_file ${LEX_FILES}) +##add_library(_doxygen STATIC ${GENERATED_SRC}/${lex_file}.l.h) +##endforeach() + add_executable(doxygen main.cpp) if (use_libclang) |