https://github.com/Kitware/CMake
Raw File
Tip revision: bd6389f7bce6d69a75e6f84245834e19b24cc03f authored by Brad King on 11 February 2015, 15:23:38 UTC
CMake 3.1.3
Tip revision: bd6389f
test_opt.sh.in
#!/bin/sh

TEST_OPT_@ID@_FOUND=0
ARGS=""
for a in "$@"; do
    if [ "x${TEST_OPT_@ID@}" != "x" -a "x${TEST_OPT_@ID@}" = "x$a" ]; then
        TEST_OPT_@ID@_FOUND=1
    else
        ARGS="$ARGS \"$a\""
    fi
done

if [ "x${TEST_OPT_@ID@}" != "x" -a "x${TEST_OPT_@ID@_FOUND}" != "x1" ]; then
    echo "Not given option '${TEST_OPT_@ID@}' as expected!"
    exit 1
fi

eval "\"@COMMAND@\"" "$ARGS"
back to top