Adding default build configuration for scheme in XCode

For now, the default build configuration in the XCode scheme is hardcoded in cmXCodeScheme.cxx. For example, the build configuration for launch action(the “RUN” command in XCode) is “Debug”.

Sometimes, it’s not what the users wanted. For the project that I’m working on, I want the default build configuration for “RUN” is “RelWithDebInfo”. Since our project is a huge one, sometimes it took a long time for me to build then realized that I did not choose the right build configuration.

I think we can add a new XCODE_SCHEME_DEFAULT_RUN_CONFIG property for users to set the default build configuration to what they want. I have created a branch to do some tests and it’s working well for me. If this is a meaningful addition to CMake, I would be more than happy to submit a merge request.

The feature seems reasonable to me.

Cc: @gjasny @brad.king

The CMAKE_DEFAULT_BUILD_TYPE variable added in CMake 3.17 is somewhat related. It is only for the Ninja Multi-config generator at the moment though.