CMake "Build Tool Mode" fails when used on C# targets
I have a C# project that I "import" into CMake via the include_external_msproject()
. When I generate for Visual Studio 2017, and execute this command:
cmake --build . --target WinZiosk --config Release
I get the following output:
18-Jan-2018 12:51:02 Microsoft (R) Build Engine version 15.5.180.51428 for .NET Framework
18-Jan-2018 12:51:02 Copyright (C) Microsoft Corporation. All rights reserved.
18-Jan-2018 12:51:02
18-Jan-2018 12:51:02 Build started 1/18/2018 12:51:02 PM.
18-Jan-2018 12:51:03 Project "E:\agent_build\FET-WZ1475-CB\source\Tools\WinZiosk\WinZiosk.csproj" on node 1 (default targets).
18-Jan-2018 12:51:03 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(750,5): error : The OutputPath property is not set for project 'WinZiosk.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\agent_build\FET-WZ1475-CB\source\Tools\WinZiosk\WinZiosk.csproj]
18-Jan-2018 12:51:03 Done Building Project "E:\agent_build\FET-WZ1475-CB\source\Tools\WinZiosk\WinZiosk.csproj" (default targets) -- FAILED.
18-Jan-2018 12:51:03
18-Jan-2018 12:51:03 Build FAILED.
18-Jan-2018 12:51:03
18-Jan-2018 12:51:03 "E:\agent_build\FET-WZ1475-CB\source\Tools\WinZiosk\WinZiosk.csproj" (default target) (1) ->
18-Jan-2018 12:51:03 (_CheckForInvalidConfigurationAndPlatform target) ->
18-Jan-2018 12:51:03 C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(750,5): error : The OutputPath property is not set for project 'WinZiosk.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Release' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [E:\agent_build\FET-WZ1475-CB\source\Tools\WinZiosk\WinZiosk.csproj]
18-Jan-2018 12:51:03
18-Jan-2018 12:51:03 0 Warning(s)
18-Jan-2018 12:51:03 1 Error(s)
If I replace the above cmake build command with this, it works:
msbuild /m /p:Configuration=Release /t:WinZiosk FrontEnd.sln
Is CMake "build tool mode" supposed to work in this case?