How to creat a very custom project

{edit} I posted before searching...bad.  Anyway this topic is covered in about ten other threads and there seems no current solution.{edit}

 

I love VS IDE, I would like to be able to use it for all my development endeavors (and they are many and varied). 

I am a .net developer during the day and a video game console programmer in my free time (and occasionally even professionally).  I do a lot of work writing code for cross compilers and currently I just create a very generic make file and use the makefile project template to direct VS to do my bidding.

There is a lot of info on creating templates but most of this seems directed towards C#, VB and J#.

I would like to create a template that will let me quickly and easily create a project for another tool chain (almost allways that tool chain is some cross compiling build of gcc).

Just overriding "cl" using a custom build tool seems to result in a loss of dependencies (perhaps dependencies depend on the compiler output in some way in which case this whole conversation is probably an exersize in wasted time)

Does anyone know of a solution to this that does not require the creation of a generic makefile...in other words a solution that would allow me to leverage not only the IDE's code creation environment but also its project management.

Ideally I would like to simply replace all calls to "cl" and "link" with their gcc equivalents (with some control over command line options of course). And use custom build tools with all the resource files.  If i could do this via a template of some sort it would be a perfect world.

I noticed you can grab "cross tools" for x64 processor, is there a means to create our own cross tools packages   I am not adverse to writting a fair amount of code to make this possible.

 



Answer this question

How to creat a very custom project

  • sunnydhiman

    This was about what i gathered. Perhaps I will end up having to build my own tool which parses the visual studio project file and either generates a makefile and calls make or builds the project by calling the cross tools directly.

    ...I dont suppose there is some api in place for parsing the project (solution ) file allready

    My motivation is not so much to make my own build process easier (creating a makefile is not all that difficult after all once you know make) but to provide a template for others who download the cross compiler tool chain and libraries. I do a lot of tutorials and my audience is often very new to programming in general. Keeping the setup process simple is crucial and so I currently recomend another IDE which allows more control over the build process.

    Thanks for your time.

  • Vibhore

    cl generates the dependency information that the IDE uses to know what files are #include'd. if you replace cl then the IDE doesn't have any way to get that information and it won't always be able to tell if your project is up-to-date or not. for example, it should still (re)build correctly if you have touched a .cpp file that is a member of the project, but if you touched a .h file then it wouldn't know that anything needed to build and would think that everything is up-to-date.

    VC++ doesn't use the same template mechanism as the other languages, so you can't create custom templates/projects using the same mechanism. instead, you can create a custom wizard using the "custom wizard wizard" (doesn't that sound stupid) found on the File->New->Project dialog, on the VC++->General page. it's a little overkill for many situations, but it should do the trick.

    in general, "makefile projects" are probably the best solution when you need to customize your build in ways that we don't support (such as replacing the toolset).

    "cross tools" or platform support can only be added by changing our code, it isn't currently an extensible mechanism that folks outside of microsoft can use.

    josh

    VC++ project system developer



  • SwissToni

    the solution file is tough, as it is a custom format. you can pretty much glean enough understanding of it just by inspection though, as it isn't too complicated.

    for the project (.vcproj) file you can use the VCProjectEngine object model to load it and then walk our object model to discover everything you'd need. (the public "object model" is the same interfaces/methods as what we use internally). you can instantiate the project engine from outside of VS (using COM, .NET, jscript etc.) or inside VS using the VS macros facility. (in fact vcbuild.exe, the command line builder for .vcproj files is just a COM driver for vcprojectengine.dll).

    hth,

    josh



  • How to creat a very custom project