2

I'm trying to automatically add an entire folder structure to a VS C++ makefile project. This isn't to make the project build (it'll always build from the scons file), I mostly want to use VS to edit the code/find in projects/intellisense etc.

I've tried the solutions suggested here : Is there a way to automatically include content files into asp.net project file? My project currently includes the tags

<ItemGroup>
  <Content Include="$([System.IO.Directory]::GetFiles('$(ProjectDir)..\', '*.cpp', SearchOption.AllDirectories))" />
  <Content Include="R:\src\FabricEngine\FabricUI\**\*.*" />
</ItemGroup>

But I haven't had any success - none of the suggestions give me the list of files in Visual Studio. Is this an MSBuild feature that isn't supported by VS perhaps? Or is it limited to managed products? Any suggestions on how to get this working?

Community
  • 1
  • 1
FrozenKiwi
  • 725
  • 5
  • 20

1 Answers1

0

Got similar problem and found that used following worked for me:

<None Include="$([System.IO.Directory]::GetFiles('$(MSBuildProjectDirectory)', '*.cpp', SearchOption.AllDirectories))" />

But issue with this is it just takes really long time and crashes if you have lot of files

Abdurrahim
  • 1,832
  • 1
  • 15
  • 15