The logic added by commit ffc0b5e4 (Overwrite the symlink if it already
exists, 2007-02-15) does not recognize and remove existing broken links
before replacing them. Improve the logic to remove any existing
destination file or link (but not directory). On failure, report an
error message explaining why the existing path could not be removed or
the new one could not be created.
Add a RunCMake.CommandLine test to cover 'cmake -E' cases. Start with
test cases covering 'cmake -E create_symlink' behavior on UNIX platforms.
On posix platforms return values are limited to a range from 0 to 255.
Cross compiling/linking with MSVC on linux/wine leads to a
misinterpretation of the return value 1090650113 of mt.exe.
Do not access an argument index not known to exist.
Port the change from commit 9ef66f2b (cmake: Validate -E cmake_automoc
argument count, 2013-11-05) to the new location of the code.
There is no need for a "cmake_automoc" backward compatibility command
because it is internal, undocumented, and only executed from a matching
version of cmake.
Move the cmake::ExecuteCMakeCommand static method and all the static
methods it calls out of the 'cmake' class to a separate 'cmcmd' class.
Build the latter as part of the main cmake executable with cmakemain.cxx
and not in CMakeLib. Drop unused header includes from "cmake.cxx".
By moving this implementation out of cmake.cxx we avoid carrying it
around in all the executables that use class 'cmake'. It is needed only
for the main "cmake -E" functionality.