summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2019-10-28 18:34:40 (GMT)
committerGitHub <noreply@github.com>2019-10-28 18:34:40 (GMT)
commit53ec4dddd1f8432b2349c034835f119bb6a93434 (patch)
tree10d72f4d7ebc4cb56714e70537997e0111a642e2
parent43ebd07c14549b20d51133dfe6fb3d1ba84d42a5 (diff)
parentcda147996c774c7d35c8b2a942f1457cdd38d4f4 (diff)
downloadDoxygen-53ec4dddd1f8432b2349c034835f119bb6a93434.zip
Doxygen-53ec4dddd1f8432b2349c034835f119bb6a93434.tar.gz
Doxygen-53ec4dddd1f8432b2349c034835f119bb6a93434.tar.bz2
Merge pull request #7338 from albert-github/feature/bug_cmake_vhdl
Adding possibility to automatically build vhdlparser from vhdlparser.jj file
-rwxr-xr-xcmake/FindJavacc.cmake10
-rw-r--r--vhdlparser/CMakeLists.txt10
2 files changed, 20 insertions, 0 deletions
diff --git a/cmake/FindJavacc.cmake b/cmake/FindJavacc.cmake
new file mode 100755
index 0000000..c7de776
--- /dev/null
+++ b/cmake/FindJavacc.cmake
@@ -0,0 +1,10 @@
+
+find_program(JAVACC_EXECUTABLE NAMES javacc javaCC Javacc JavaCC javacc.bat DOC "path to the javacc executable")
+mark_as_advanced(JAVACC_EXECUTABLE)
+if(JAVACC_EXECUTABLE)
+ set(JAVACC_FOUND 1)
+ message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE}")
+else()
+ set(JAVACC_FOUND 0)
+ message(STATUS "The javacc executable not found, using existing files")
+endif()
diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt
index f89008c..ad5af28 100644
--- a/vhdlparser/CMakeLists.txt
+++ b/vhdlparser/CMakeLists.txt
@@ -1,3 +1,13 @@
+find_package(Javacc)
+if (JAVACC_FOUND)
+ add_custom_command(
+ COMMAND ${JAVACC_EXECUTABLE} -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/JavaCC.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()
+
include_directories(${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/qtools ${GENERATED_SRC})
add_library(vhdlparser STATIC
CharStream.cc