summaryrefslogtreecommitdiffstats
path: root/addon/doxmlparser/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'addon/doxmlparser/CMakeLists.txt')
-rw-r--r--addon/doxmlparser/CMakeLists.txt30
1 files changed, 22 insertions, 8 deletions
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()
+