Converting Visual Studio solutions to SCons
A python script to convert Microsoft Visual Studio 2005 solution files (*.sln) and the associated project files (*.vcproj) into a set of SCons files (SConstruct and SConscript).
A python script to convert Microsoft Visual Studio 2005 solution files (*.sln) and the associated project files (*.vcproj) into a set of SCons files (SConstruct and SConscript).
A python script to convert Microsoft Visual Studio 2005 solution files (*.sln) and the associated project files (*.vcproj) into a set of Makefile’s.
The class Sln2Make does all the work, parses the sln and vcproj files and generates a main Makefile and one Makefile.ag for every project in the solution. The Makefiles.ag generated will have two targets, ‘all’ and ‘clean’, the script also includes the dependent libraries if they are properly defined in the solution. To use it, just instantiate the class with the following parameters:
Sln2Make(slnpath, exlist, dirrepl, librepl)
where:
example:
exlist = [('../extsrc/zlib/projects/visualc6/Makefile.ag',
' $(MAKE) -C $(dir_root)extsrc/zlib -f Makefile libz.a\n',
' $(MAKE) -C $(dir_root)extsrc/zlib -f Makefile clean\n')]
dirrepl = [['winnt', 'linux']]
librepl = [['zlib', 'z'], ['nspr', 'nspr4 -lplc4 -lplds4']]
#
Sln2Make("../winnt/test.sln", exlist, dirrepl, librepl)
To correct the path case, I’ve used a script published by Moshe Zadka here.
Download sln2make here. Use this code at your own risk, it is released under BSD license.