Automatically include all .cpp/.h files of a folder in a vcproj Project in Visual Studio
Asked Answered
M

1

13

Is there a way to set a vcproj Project folder in order to automatically include all .cpp or .h files depending on the path of the project ?

On other words, when adding files to the folder of my project using Windows explorer, is it possible to have these new files automatically added to a vcproj Project, inside Visual Studio ? (even if I have to relaunch Visual Studio).
I do not need just to see them, but I need them to be automatically included inside the project for compiling and other operations...

The only way I see is to create a Visual Studio addin or a VB Script to do that...

Thanks, Regards

Medan answered 11/2, 2011 at 15:10 Comment(2)
What are you trying to accomplish here? Are you generating code and you want the code to be compiled? If that, why not generate a vcproj for the generated files?Legofmutton
I just want to be able to use several IDE, and have all the source files automatically taken into account into my vcproj Project. For exemple, I have to use Eclipse and Visual Studio. When an user create a file with Eclipse, I would like this file to be automatically inserted inside the Visual Studio project without doing it file by file by hand.Medan
S
1

You can edit project file and use wildcards. http://msdn.microsoft.com/en-us/library/ms171454%28v=VS.90%29.aspx

Spirograph answered 3/3, 2011 at 9:29 Comment(2)
But be careful. Visual Studio occasionally expands the wildcards out and re-saves the project file.Yahairayahata
This doesn't seem to work with VC++ projects. The vcproj format file is not the same as the C# and VB one. When using wildcard, Visual insert the wildcard as a file... which do not work. Furthermore, Visual seems to ask for the mandatory flag "RelativePath" instead of "Include" (C# and VB).Medan

© 2022 - 2024 — McMap. All rights reserved.