[cmake-developers] Link element in C# project causing issues with binary dir

Robert Dailey rcdailey.lists at gmail.com
Fri Jun 29 16:08:00 EDT 2018


When I use configure_file() to generate AssemblyInfo.cs, which I allow
to go to the CMAKE_CURRENT_BINARY_DIR, Visual Studio 2017 reports:

Warning The file
'E:\code\layout-composer-build\Properties\AssemblyInfo.cs' could not
be added to the project.  Cannot add a link to the file
E:\code\layout-composer-build\Properties\AssemblyInfo.cs. This file is
within the project directory tree.

When I define a target using C# language, it adds this for files under
the same directory as the generated CSPROJ file:

<Compile Include="E:\code\layout-composer-build\Properties\AssemblyInfo.cs">
  <Link>build\Properties\AssemblyInfo.cs</Link>
</Compile>

The CSPROJ file is located: E:\code\layout-composer-build\LayoutComposer.csproj

Is there a way to make the <Link> element not needed in this scenario?


More information about the cmake-developers mailing list