summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-02-03 20:07:12 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2021-02-03 20:07:12 (GMT)
commita53db9b77a2df94cb9a1eaf4f6c305a92f432a14 (patch)
tree4407e5969d3849fcc3a938fdf8fcee50eef8d493
parent095c5de5e4df192898f7f13e9b51524999615983 (diff)
downloadDoxygen-a53db9b77a2df94cb9a1eaf4f6c305a92f432a14.zip
Doxygen-a53db9b77a2df94cb9a1eaf4f6c305a92f432a14.tar.gz
Doxygen-a53db9b77a2df94cb9a1eaf4f6c305a92f432a14.tar.bz2
Detect generateDS and recreate index.py/compound.py automatically
-rw-r--r--CMakeLists.txt1
-rw-r--r--addon/CMakeLists.txt4
-rw-r--r--addon/doxmlparser/CMakeLists.txt30
-rwxr-xr-xcmake/FindJavacc.cmake12
-rw-r--r--cmake/FindgenerateDS.cmake19
5 files changed, 51 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2dcf8f4..fafb56e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ project(doxygen)
option(build_wizard "Build the GUI frontend for doxygen." OFF)
option(build_app "Example showing how to embed doxygen in an application." OFF)
option(build_parse "Parses source code and dumps the dependencies between the code elements." OFF)
+option(build_xmlparser "Automatically update the XML parser modules when updating the schema files." OFF)
option(build_search "Build external search tools (doxysearch and doxyindexer)" OFF)
option(build_doc "Build user manual (HTML and PDF)" OFF)
option(build_doc_chm "Build user manual (CHM)" OFF)
diff --git a/addon/CMakeLists.txt b/addon/CMakeLists.txt
index fd8c73f..ec4706b 100644
--- a/addon/CMakeLists.txt
+++ b/addon/CMakeLists.txt
@@ -1,4 +1,6 @@
-add_subdirectory(doxmlparser)
+if (build_xmlparser)
+ add_subdirectory(doxmlparser)
+endif ()
if (build_app)
add_subdirectory(doxyapp)
diff --git a/addon/doxmlparser/CMakeLists.txt b/addon/doxmlparser/CMakeLists.txt
index dbbeee4..6ef5568 100644
--- a/addon/doxmlparser/CMakeLists.txt
+++ b/addon/doxmlparser/CMakeLists.txt
@@ -1,8 +1,22 @@
-# this custom rule depends on generateDS, install with 'pip install generateDS'
-add_custom_target(update_doxmlparser
- COMMENT "Updating doxmlparser module from XML schema files"
- COMMAND generateDS --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
- COMMAND generateDS --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
- DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
- DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
- )
+find_package(generateDS)
+if (GENERATEDS_FOUND)
+ add_custom_command(
+ COMMENT "Updating index.py from index.xsd..."
+ COMMAND ${GENERATEDS_EXECUTABLE} --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
+ DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
+ OUTPUT ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py
+ )
+ add_custom_command(
+ COMMENT "Updating compound.py from compound.xsd..."
+ COMMAND ${GENERATEDS_EXECUTABLE} --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
+ DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
+ OUTPUT ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py
+ )
+ add_custom_target(
+ update_doxmlparser_files ALL
+ DEPENDS ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py
+ DEPENDS ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py
+ COMMENT "Updating doxmlparser module..."
+ )
+endif()
+
diff --git a/cmake/FindJavacc.cmake b/cmake/FindJavacc.cmake
index a134020..97a7827 100755
--- a/cmake/FindJavacc.cmake
+++ b/cmake/FindJavacc.cmake
@@ -1,25 +1,25 @@
find_program(JAVACC_EXECUTABLE NAMES javacc javaCC Javacc JavaCC javacc.bat DOC "path to the javacc executable")
mark_as_advanced(JAVACC_EXECUTABLE)
+set(JAVACC_FOUND 0)
if(JAVACC_EXECUTABLE)
- set(JAVACC_FOUND 1)
- message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE}")
execute_process(
COMMAND "${JAVACC_EXECUTABLE}" -version
OUTPUT_VARIABLE JAVACC_TEMP_VERSION
)
string(REGEX MATCH ".* ([0-9]+(\\.[0-9]+)+) .*" JAVACC_TEMP_VERSION2_UNUSED "${JAVACC_TEMP_VERSION}")
if(CMAKE_MATCH_1)
+ set(JAVACC_FOUND 1)
set(JAVACC_VERSION ${CMAKE_MATCH_1})
else()
string(REGEX MATCH "([0-9]+(\\.[0-9]+)+)" JAVACC_TEMP_VERSION3_UNUSED "${JAVACC_TEMP_VERSION}")
if(CMAKE_MATCH_1)
+ set(JAVACC_FOUND 1)
set(JAVACC_VERSION ${CMAKE_MATCH_1})
- else()
- message(STATUS "Unable to determine JavaCC version, using existing files")
- set(JAVACC_FOUND 0)
endif()
endif()
+endif()
+if(JAVACC_FOUND)
+ message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE} (found version \"${JAVACC_VERSION}\")")
else()
- set(JAVACC_FOUND 0)
message(STATUS "The javacc executable not found, using existing files")
endif()
diff --git a/cmake/FindgenerateDS.cmake b/cmake/FindgenerateDS.cmake
new file mode 100644
index 0000000..77011fc
--- /dev/null
+++ b/cmake/FindgenerateDS.cmake
@@ -0,0 +1,19 @@
+find_program(GENERATEDS_EXECUTABLE NAMES generateDS generateDS.py DOC "path to the generateDS executable")
+mark_as_advanced(GENERATEDS_EXECUTABLE)
+set(GENERATEDS_FOUND 0)
+if(GENERATEDS_EXECUTABLE)
+ execute_process(
+ COMMAND "${GENERATEDS_EXECUTABLE}" --version
+ OUTPUT_VARIABLE GENERATEDS_TEMP_VERSION
+ )
+ string(REGEX MATCH ".* ([0-9]+(\\.[0-9]+)+)" GENERATEDS_TEMP_VERSION_UNUSED "${GENERATEDS_TEMP_VERSION}")
+ if(CMAKE_MATCH_1)
+ set(GENERATEDS_FOUND 1)
+ set(GENERATEDS_VERSION ${CMAKE_MATCH_1})
+ endif()
+endif()
+if(GENERATEDS_FOUND)
+ message(STATUS "The generateDS executable: ${GENERATEDS_EXECUTABLE} (found version \"${GENERATEDS_VERSION}\")")
+else()
+ message(STATUS "The generateDS executable not found, using existing files")
+endif()