Only add files that were named on the command line, don't implicitly
add a .hpp file when the .cpp file was given. Previously the script
both needed the .hpp (for Xcode) and failed when the .hpp was given
(for CodeBlocks).
Add the following checks, and if any of them fail exit before making
any changes. Also add a --no-checks option to proceed anyway.
* Check the files exist
* If a .cpp is given and the .hpp exists, check it was given too.
* If a .hpp is given and the .cpp exists, check it was given too.
For the files used by CMake and SCons, .hpp files were never added,
and they still won't be.
Treat an argument of "--help" as a request to print help, instead of a filename
to add to the source lists.
Treat the arguments "src/foo.cpp" "src/foo.hpp" as two filenames, instead of
adding src/foo.cpp to target src/foo.hpp. The old command line
./add_source_file a b c
becomes
./add_source_file a --target b --target c
When saying that pbxproj is required, suggest optionally using a venv instead
of installing systemwide.
Usage: ./add_source_file <filename> [target ...]
Targets are "wesnoth", "wesnothd", "campaignd", "lua", "tests".
It defaults to the "wesnoth" target.
The 'pbxproj' python package is required to modify the Xcode project.
[ci skip]