Build tool mode with MSBuild not ignoring targets excluded from default
I am using the Build Tool Mode in CMake 3.7.1 to build INSTALL targets in a MSVC11 build folder. According to the documentation (and the output from MSBuild), it should be building 'default targets' only, but it doesn't specify what that means exactly.
This is building every single target in the solution, even if they have been turned off by EXCLUDE_FROM_DEFAULT_BUILD, EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG>, or even EXCLUDE_FROM_ALL. Seemingly the only way I can prevent the excluded project from being built is to remove the target as a dependency on other targets, or invoke MSBuild with the solution file directly, which isn't very cross-platform friendly, and I'd prefer to utilize CMake's knowledge of the build tools than write my own MSBuild finder.
I have a runtime library and a plugin that is loaded in an executable. The runtime library is being built for multiple configurations (Release, Debug, Release_mdd, Debug_md), but the plugin is only supposed to build in Release and Debug. I have excluded the plugin from the default build:
I can call MSBuild with the solution file, and it correctly ignores the builds that are marked as excluded, but AFAIK CMake's build tool mode doesn't support this right now, I believe because of the usage of the References in ALL BUILD causes all referenced projects to be built, regardless of the solution configuration ('fixable' by using /p:BuildProjectReferences=false as an option to MSBuild)
Looking through the code (cmGlobalVisualStudio10Generator::GenerateBuildCommand), it seems I can 'spoof' it into using the sln and ignoring the ALL_BUILD vcxproj file completely if I specify 'clean' as the target, and then add /t:Build to the end of the command line. I'd rather not do this, as it doesn't remove the 'clean' option.
I guess my question is if the build tool mode is making assumptions about what file I want it to build with?
As a workaround, is there an option to force it to use devenv for the time being?