aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/CMakeLists.txt12
1 files changed, 8 insertions, 4 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index d49221d..7963474 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -23,18 +23,22 @@
##################################################
PROJECT_TARGET_ADD(ucs2_config)
- file(GLOB SOURCE_FILES "*.xml")
+ file(GLOB XML_FILES "*.xml")
+ set(XML_SCHEMA unicens.xsd)
add_custom_target(${TARGET_NAME}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
)
+ # check XML schema before pushing config
add_custom_command(
- DEPENDS ${SOURCE_FILES}
+ DEPENDS ${XML_FILES}
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND xmllint -schema ${XML_SCHEMA} ${XML_FILES} --noout
COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
- COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
- COMMAND cp -r ${SOURCE_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND cp -r ${XML_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
)
SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES