cmake -P: "Unparsed-options" actually parsed
Overview
CMake 3.18 documentation says "Any options after -- are not parsed by CMake" in the section of "Run a Script", but it actually parses some options and causes weird error.
#18978 was talking about it.
Steps to reproduce
- Create a file
test.cmake
message (STATUS OK)
- Run command line
cmake -P test.cmake -- --version
Expected behavior
CMake prints "OK".
Actual behavior
The following result is gotten.
CMake Error at test.cmake:1 (message):
Unknown CMake command "message".
cmake version 3.18.0
CMake suite maintained and supported by Kitware (kitware.com/cmake).
Edited by Brad King