summaryrefslogtreecommitdiffstats
path: root/cmake/cmake.d/02-macros.cmake
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-08-15 19:03:55 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-10-15 18:22:47 +0200
commit3fe1073c8a0793ae712c3cfd902df0a008ebaa44 (patch)
tree9d76040f46827eb1a9cca8e554ef4f69373f4ad5 /cmake/cmake.d/02-macros.cmake
parent3262bd7940fcf09305ebf7952b12c63f85c7682c (diff)
Ease standard target DATA and HTDOCS creation
This will create a custom target which make sure input files are correct (linting or compiling them) then copying them into the target build dir Change-Id: I1d346d4611a6d97682a00d2038de41a643b28928 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'cmake/cmake.d/02-macros.cmake')
-rw-r--r--cmake/cmake.d/02-macros.cmake22
1 files changed, 22 insertions, 0 deletions
diff --git a/cmake/cmake.d/02-macros.cmake b/cmake/cmake.d/02-macros.cmake
index 3787817..3e4b919 100644
--- a/cmake/cmake.d/02-macros.cmake
+++ b/cmake/cmake.d/02-macros.cmake
@@ -48,6 +48,28 @@ macro(configure_files_in_dir dir)
endforeach()
endmacro(configure_files_in_dir)
+# Create custom target dedicated for HTML5 and DATA AGL target type
+macro(add_input_files INPUT_FILES)
+ add_custom_target(${TARGET_NAME}
+ DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ )
+
+ add_custom_command(TARGET ${TARGET_NAME}
+ PRE_BUILD
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND [ -f *xml ] && ${XML_CHECKER} ${INPUT_FILES}
+ COMMAND [ -f *lua ] && ${LUA_CHECKER} ${INPUT_FILES}
+ COMMAND [ -f *json ] && for f in ${INPUT_FILES}; do cat ${INPUT_FILES} | ${JSON_CHECKER}; done
+ )
+
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ DEPENDS ${INPUT_FILES}
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND mkdir -p ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ COMMAND cp -r ${INPUT_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}
+ )
+endmacro()
# Pre-packaging
macro(project_targets_populate)
# Default Widget default directory