CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2020-01-05T22:43:36-05:00https://gitlab.kitware.com/cmake/cmake/-/issues/19737VS: 16.4.0 warns on CustomBuild that does not create all outputs2020-01-05T22:43:36-05:00Santiago Fernandez MaderoVS: 16.4.0 warns on CustomBuild that does not create all outputsWe are using Visual Studio 16 generator, and then we try to build INSTALL.vcxproj using msbuild. However with 16.4.0 (which is in early previews) we're getting a warning like this one:
> (CustomBuild target) ->
C:\Program Files (x86)...We are using Visual Studio 16 generator, and then we try to build INSTALL.vcxproj using msbuild. However with 16.4.0 (which is in early previews) we're getting a warning like this one:
> (CustomBuild target) ->
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(230,5): warning MSB8065: Custom build for item "E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\CMakeFiles\6588b57184d8ccf55ab7eca0b7ac55b9\INSTALL_force.rule" succeeded, but specified output "e:\repos\corefx\artifacts\obj\na tive\netcoreapp-windows_nt-debug-x64\cmakefiles\install_force" has not been created. This may cause incremental build to work incorrectly. [E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x64\install.vcxproj]
I did a little investigation by cracking opening the Build Tasks dll that Visual Studio uses to execute custom commands and it seems like they now do validation that after executing the command the output file specified as part of the custom command exists, if it doesn't exist, it logs that warning. This seems like an issue with the CustomBuild as it is not doing anything, it is just running `cd .` as part of the command, of course no file will be creates as an output. This is the `CustomBuild` item definition I see in my produced vcxproj.
```xml
<CustomBuild Include="E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x86\CMakeFiles\4696b813a8447feb4893b87d575ddcd6\INSTALL_force.rule">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> </Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">setlocal
cd .
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x86\CMakeFiles\INSTALL_force</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> </Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">setlocal
cd .
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x86\CMakeFiles\INSTALL_force</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'"> </Message>
<Command Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">setlocal
cd .
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x86\CMakeFiles\INSTALL_force</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='MinSizeRel|Win32'">false</LinkObjects>
<Message Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'"> </Message>
<Command Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">setlocal
cd .
if %errorlevel% neq 0 goto :cmEnd
:cmEnd
endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
:cmErrorLevel
exit /b %1
:cmDone
if %errorlevel% neq 0 goto :VCEnd</Command>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">%(AdditionalInputs)</AdditionalInputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">E:\repos\corefx\artifacts\obj\native\netcoreapp-Windows_NT-Debug-x86\CMakeFiles\INSTALL_force</Outputs>
<LinkObjects Condition="'$(Configuration)|$(Platform)'=='RelWithDebInfo|Win32'">false</LinkObjects>
</CustomBuild>
```
Any suggestions?
We of course, could use
```
cmake --build <dir>
cmake --install <dir>
```
after generating the build tree, but I don't know if it is worth the change, since we somehow rely on VS.
/cc @brad.king3.15.5Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/19829InstallRequiredSystemLibraries: vcruntime140_1.dll is not included2019-11-04T10:55:34-05:00Damian PłóciennikInstallRequiredSystemLibraries: vcruntime140_1.dll is not includedFor a few weeks VS2019 needs to have `vcruntime140_1.dll`. After using `include(InstallRequiredSystemLibraries)` and CPack I have `vcruntime140.dll` in output directory, but I haven't `vcruntime140_1.dll`.
For a few weeks VS2019 needs to have `vcruntime140_1.dll`. After using `include(InstallRequiredSystemLibraries)` and CPack I have `vcruntime140.dll` in output directory, but I haven't `vcruntime140_1.dll`.
3.15.5Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/19828VS: CMake is missing v142 toolset CSharp flag table2019-10-30T10:19:40-04:00KonanMVS: CMake is missing v142 toolset CSharp flag tableI have no idea what Flag Tables are and why they are needed, but there seems to be a problem that one of those flag tables files is missing. The problem appears when trying to use add_subdirectory on projects using some mixed C++/Cli and...I have no idea what Flag Tables are and why they are needed, but there seems to be a problem that one of those flag tables files is missing. The problem appears when trying to use add_subdirectory on projects using some mixed C++/Cli and CSharp.
```project(ProjectName LANGUAGES C CXX CSharp)```
The fix was to create a copy of the v141_CSharp.json in that FlagTables folder and rename it to v142_CSharp.json. If that's all there is to fix this issue, I would also be willing to create a pull request for it.
```
1> [CMake] -- add_subdirectory(SomeFolder)
1> [CMake] -- The CSharp compiler identification is Microsoft unknown 9999
1> [CMake] -- The CSharp compiler version is 3.3.1
1> [CMake] -- Check for working C# compiler: E:/VS 2019 Professional/MSBuild/Current/Bin/Roslyn/csc.exe
1> [CMake] CMake Error in K:/_CM/.cache/de46f986-66b1-9c34-aa44-e533cd651321/build/D/CMakeFiles/CMakeTmp/CMakeLists.txt:
1> [CMake] JSON flag table "E:/VS 2019
1> [CMake] Professional/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/share/cmake 3.15/Templates/MSBuild/FlagTables/v142_CSharp.json" could not be loaded.
```
I first thought that this is a Visual Studio issue, but a local CMake installation has the same problem.
See also https://developercommunity.visualstudio.com/content/problem/729347/vs-201924-cmake-314templatesmsbuildflagtablesv142.html3.15.5Brad KingBrad Kinghttps://gitlab.kitware.com/cmake/cmake/-/issues/19759CMAKE_XCODE_GENERATE_SCHEME does not generate schemes for custom targets2019-10-30T10:18:59-04:00Martin SanderCMAKE_XCODE_GENERATE_SCHEME does not generate schemes for custom targetsUp to 3.14.6 with CMAKE_XCODE_GENERATE_SCHEME=ON schemes were created for all targets.
3.15.0+ does not create schemes for targets created with ADD_CUSTOM_TARGET, only for ADD_LIBRARY and ADD_EXECUTABLEUp to 3.14.6 with CMAKE_XCODE_GENERATE_SCHEME=ON schemes were created for all targets.
3.15.0+ does not create schemes for targets created with ADD_CUSTOM_TARGET, only for ADD_LIBRARY and ADD_EXECUTABLE3.15.5Brad KingBrad King