CMake/Tests/RunCMake/cmake_parse_arguments/Errors.cmake
Matthias Maennich ab8a280857 cmake_parse_arguments: consider duplicate keyword as warning
The behaviour of double specified keywords is rather undefined or at
least not clearly documented. This change introduces a strict check and
emits a warning in case a keyword has been specified more than once.
2015-12-17 10:45:19 -05:00

15 lines
480 B
CMake

# wrong argument count
cmake_parse_arguments()
cmake_parse_arguments(prefix OPT)
cmake_parse_arguments(prefix OPT SINGLE)
cmake_parse_arguments(prefix OPT SINGLE MULTI) # not an error
# duplicate keywords
cmake_parse_arguments(prefix "OPT;OPT" "" "")
cmake_parse_arguments(prefix "" "OPT;OPT" "")
cmake_parse_arguments(prefix "" "" "OPT;OPT")
cmake_parse_arguments(prefix "OPT" "OPT" "")
cmake_parse_arguments(prefix "" "OPT" "OPT")
cmake_parse_arguments(prefix "OPT" "" "OPT")