Create a new file for Visual Studio C ++ project from command line using / Command parameter

From the command line, I need to create a new C ++ source or header file for an existing project.

I found that Visual Studio provides commands to interact directly with the IDE from the command window. The page ( http://msdn.microsoft.com/en-us/library/f42eyh2e.aspx ) introduces a new file command, but does not say if this command can be used to create a new file for any particular project. (I guess what can be done from the command line can be done from the command line).

Could you please let me know if this can be done using the command option, if so how?

I found a related question: create a new visual studio project, add files and run them - command line . He recommends updating the vcxproj file with CMake. I prefer to do this via the command line if possible.

thank

+3


source to share


1 answer


Generating a code file regardless of the header or source file is achieved simply by copying or echoing as they are plain text files. Now, in order to attach them to a VS project, you need to work a little harder.

Project file: * .vcxproj is what defines your project settings. It contains information on how to create it and what files contain it.



As per this thread , I would recommend using CMake to generate your vcxproj file . Basically the only thing you need is a text file to define your dependencies.

0


source







All Articles