cmake -P run script error with --version
Given a script:
$ cat echo.cmake
message(STATUS "CMAKE_ARGV4: ${CMAKE_ARGV4}")
run it on command line:
$ cmake -P echo.cmake -- --version
CMake Error at echo.cmake:1 (message):
Unknown CMake command "message".
cmake version 3.21.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
But according to the document of Run a Script,
Any options after -- are not parsed by CMake
And I got similar error with cmake -P echo.cmake -- --help
.