diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,8 +88,8 @@ # not just by accident if the build directory is a subdir of the root source dir add_custom_target(breeze-validate-svg ALL COMMENT "Validating SVG" - COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/validate_svg.sh - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${SH_EXE} ${CMAKE_SOURCE_DIR}/validate_svg.sh ${CMAKE_CURRENT_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} SOURCES ${SVGS} ${DARK_SVGS} ) endif() diff --git a/validate_svg.sh b/validate_svg.sh --- a/validate_svg.sh +++ b/validate_svg.sh @@ -1,6 +1,6 @@ #!/bin/sh -find . -type f -name '*.svg' -exec xmllint --noout {} + 2> xmlerrors +find ${1:-.} -type f -name '*.svg' -exec xmllint --noout {} + 2> xmlerrors if [ -s xmlerrors ]; then cat xmlerrors rm xmlerrors