summaryrefslogtreecommitdiffstats
path: root/vhdlparser/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'vhdlparser/CMakeLists.txt')
-rw-r--r--vhdlparser/CMakeLists.txt21
1 files changed, 21 insertions, 0 deletions
diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt
index 3e52817..53983f5 100644
--- a/vhdlparser/CMakeLists.txt
+++ b/vhdlparser/CMakeLists.txt
@@ -1,11 +1,32 @@
+#
+# Generate parser (default target)
+#
+# when generating the parser with debug options it will look like:
+# make JAVACC_FLAGS=-debug_parser
+# or
+# make JAVACC_FLAGS="-debug_parser -debug_lookahead"
+#
+# Available debug options:
+# -debug_parser
+# -debug_token_manager
+# -debug_lookahead
+#
+# For other javacc settings / options consult the documentation of javacc.
+
find_package(Javacc)
if (JAVACC_FOUND)
+ if (JAVACC_VERSION VERSION_LESS 7.0.5)
+ message(STATUS " Doxygen requires at least JavaCC version 7.0.5 (installed: ${JAVACC_VERSION})")
+ message(STATUS " Fall back to JavaCC not installed, using existing files.")
+ else()
+
add_custom_command(
COMMAND ${JAVACC_EXECUTABLE} ${JAVACC_FLAGS} -OUTPUT_DIRECTORY=${CMAKE_SOURCE_DIR}/vhdlparser ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj
DEPENDS ${CMAKE_SOURCE_DIR}/vhdlparser/vhdlparser.jj
OUTPUT ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.cc ${CMAKE_SOURCE_DIR}/vhdlparser/CharStream.h ${CMAKE_SOURCE_DIR}/vhdlparser/ErrorHandler.h ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.cc ${CMAKE_SOURCE_DIR}/vhdlparser/ParseException.h ${CMAKE_SOURCE_DIR}/vhdlparser/Token.cc ${CMAKE_SOURCE_DIR}/vhdlparser/Token.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenManager.h ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.cc ${CMAKE_SOURCE_DIR}/vhdlparser/TokenMgrError.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParser.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserConstants.h ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.cc ${CMAKE_SOURCE_DIR}/vhdlparser/VhdlParserTokenManager.h
)
+ endif()
endif()
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC})