aboutsummaryrefslogtreecommitdiffstats
path: root/data/CMakeLists.txt
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-07-19 21:52:53 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-07-19 21:52:53 +0200
commit359083b3a1852e0993dd657d74354955ef25ee44 (patch)
treee25f192eab53150e8e91bd2177cf19c9c70f2bb2 /data/CMakeLists.txt
parent07b52f2a1a51a0715e03346229d72bb3c7154b2b (diff)
Added XML schema check at build time
Diffstat (limited to 'data/CMakeLists.txt')
-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