File: makeVCXProj.py

package info (click to toggle)
tulip 4.8.0dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 179,264 kB
  • ctags: 64,517
  • sloc: cpp: 600,444; ansic: 36,311; makefile: 22,136; python: 1,304; sh: 946; yacc: 522; xml: 337; pascal: 157; php: 66; lex: 55
file content (546 lines) | stat: -rwxr-xr-x 18,941 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
# Make VCXProj
#
# November 2012
# Markus Chimani, markus.chimani@uni-jena.de
# Carsten Gutwenger, carsten.gutwenger@cs.tu-dortmund.de
#########################################################

# use Python 3 print function on both Python 2.x and Python 3.x
from __future__ import print_function

import os, sys, fnmatch

# Simple hack for using "configparser" on both Python 2 and 3
if sys.hexversion > 0x03000000:
	import configparser
else:
	import ConfigParser
	configparser = ConfigParser


class stuff:
	def __init__(self, ttag, tpath, tpats, tcommand, tfilter):
		self.tag, self.path, self.pats, self.command, self.filter = ttag, tpath, tpats, tcommand, tfilter

def bailout(msg):
	print(msg)
	print('Please use the original makeVCXProj.config as a template')
	sys.exit()

def loadConfig(sect, key, noError = False ):
	if config.has_option(sect, key):
		v = config.get(sect, key)
		print('   [', sect, ']', key, '=', v)
		return v
	else:
		if noError:
			return None
		else:
			bailout('Option "' + key + '" in section "' + sect + '" is missing')

def checkSolver(name, defSolver, extSolvers):
	if(name == defSolver):
		return True
	for s in extSolvers:
		s = s.strip()
		if(name == s):
			return True
	return False

def getLibs(libsConfig):
	libs = ''
	for str in libsConfig.split(';'):
		str = str.strip();
		if str != '':
			libs += str + ';'
	return libs


#########################################################
# LOAD CONFIGURATION

config = configparser.ConfigParser()

makecfg = 'makeVCXProj.config'
for x in sys.argv[1:]:
	if x[:7] == "config=":
		makecfg = x[7:]

print('Loading ' + makecfg + '...')

try:
	config.readfp( open(makecfg))
except IOError:
	bailout(makecfg + ' not found')

if not config.has_section('GENERAL'):
	bailout('Section "GENERAL" is missing')
if not config.has_section('OGDF'):
	bailout('Section "OGDF" is missing')
if not config.has_section('OGDF-TEST'):
	bailout('Section "OGDF-TEST" is missing')
if not config.has_section('COIN'):
	bailout('Section "COIN" is missing')

#########################################################
# CONFIGS

platformToolset = loadConfig('GENERAL', 'platformToolset')
windowsVersion = loadConfig('GENERAL', 'windowsVersion')
createSolution = loadConfig('GENERAL', 'createSolution').startswith('t')

# Filenames
filename_sln = loadConfig('GENERAL', 'solutionFile')
filename_vcxproj =  loadConfig('OGDF', 'projectFile')
filename_template = loadConfig('OGDF', 'templateFile')
filename_vcxfilters =  loadConfig('OGDF', 'projectFiltersFile')
filename_template_filters = loadConfig('OGDF', 'templateFiltersFile')
addDefines = ''
addIncludes = ''
addLibs = ''
addLibsWin32 = ''
addLibsWin32 = ''
addLibsX64 = ''
addLibsX64 = ''

# defines for auto generated config_autogen.h header file
config_defines = ''

createDLL = loadConfig('OGDF', 'DLL', True)

memoryManager = loadConfig('OGDF', 'memoryManager', True)
if memoryManager:
	config_defines += '#define ' + memoryManager + '\n'

ogdfOpenMP = 'false'
coinOpenMP = 'false'
ogdfEnableOpenMP = loadConfig('OGDF', 'OpenMP', True)
if ogdfEnableOpenMP and ogdfEnableOpenMP.startswith('t'):
	ogdfOpenMP = 'true'

useCoin = loadConfig('COIN', 'useCoin').startswith('t')
addOsiCpx = False
addOsiGrb = False
addLibsDebugWin32 = ''
addLibsReleaseWin32 = ''
addLibsDebugX64 = ''
addLibsReleaseX64 = ''
if useCoin:
	filename_coin_vcxproj =  loadConfig('COIN', 'projectFile')
	filename_coin_template = loadConfig('COIN', 'templateFile')
	filename_coin_vcxfilters =  loadConfig('COIN', 'projectFiltersFile')
	filename_coin_template_filters = loadConfig('COIN', 'templateFiltersFile')

	coinEnableOpenMP = loadConfig('COIN', 'OpenMP', True)
	if coinEnableOpenMP and coinEnableOpenMP.startswith('t'):
		coinOpenMP = 'true'

	defaultSolver   = loadConfig('COIN', 'defaultSolver')
	externalSolvers = loadConfig('COIN', 'externalSolvers').split(';')
	solverIncludes  = loadConfig('COIN', 'solverIncludes').split(';')

	addOsiCpx = checkSolver('CPX', defaultSolver, externalSolvers)
	addOsiGrb = checkSolver('GRB', defaultSolver, externalSolvers)

	config_defines += '#define USE_COIN\n'
	config_defines += '#define COIN_OSI_' + defaultSolver + '\n'

	for s in externalSolvers:
		s = s.strip();
		if s != '':
			config_defines += '#define OSI_' + s.strip() + '\n'

	for p in solverIncludes:
		p = p.strip()
		if p != '':
			addIncludes += p + ';'

	addLibs += 'coin.lib;'

	addLibsDebugWin32   += getLibs(loadConfig('COIN', 'solverLibs_win32_debug'))
	addLibsReleaseWin32 += getLibs(loadConfig('COIN', 'solverLibs_win32_release'))
	addLibsDebugX64     += getLibs(loadConfig('COIN', 'solverLibs_x64_debug'))
	addLibsReleaseX64   += getLibs(loadConfig('COIN', 'solverLibs_x64_release'))

linkSectionD32 = ''
linkSectionR32 = ''
linkSectionD64 = ''
linkSectionR64 = ''
if createDLL and createDLL.startswith('t'):
	libraryType = 'DynamicLibrary'
	config_defines += '#define OGDF_DLL\n'
	addDefines += 'OGDF_INSTALL'

	linkSectionBegin = '    <Link>\n\
	<AdditionalDependencies>';
	linkSectionEnd = 'kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\n\
	<LinkTimeCodeGeneration>\n\
	</LinkTimeCodeGeneration>\n\
    <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\n\
    </Link>'

	linkSectionD32 = linkSectionBegin + addLibs + addLibsDebugWin32   + linkSectionEnd
	linkSectionR32 = linkSectionBegin + addLibs + addLibsReleaseWin32 + linkSectionEnd
	linkSectionD64 = linkSectionBegin + addLibs + addLibsDebugX64     + linkSectionEnd
	linkSectionR64 = linkSectionBegin + addLibs + addLibsReleaseX64   + linkSectionEnd

else:
	libraryType = 'StaticLibrary'

linkSectionProgramBegin = '    <Link>\n\
      <SubSystem>Console</SubSystem>\n\
      <AdditionalDependencies>';
linkSectionProgramEnd = 'ogdf.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\n\
      <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\n\
    </Link>'
linkSectionProgramEndDebug = 'ogdf.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;psapi.lib;%(AdditionalDependencies)</AdditionalDependencies>\n\
      <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\n\
      <GenerateDebugInformation>true</GenerateDebugInformation>\n\
    </Link>'

linkSectionProgramD32 = linkSectionProgramBegin + addLibs + addLibsDebugWin32   + linkSectionProgramEndDebug
linkSectionProgramR32 = linkSectionProgramBegin + addLibs + addLibsReleaseWin32 + linkSectionProgramEnd
linkSectionProgramD64 = linkSectionProgramBegin + addLibs + addLibsDebugX64     + linkSectionProgramEndDebug
linkSectionProgramR64 = linkSectionProgramBegin + addLibs + addLibsReleaseX64   + linkSectionProgramEnd

	
filename_ogdf_test_vcxproj =  loadConfig('OGDF-TEST', 'projectFile')
filename_ogdf_test_template = loadConfig('OGDF-TEST', 'templateFile')
filename_ogdf_test_vcxfilters =  loadConfig('OGDF-TEST', 'projectFiltersFile')
filename_ogdf_test_template_filters = loadConfig('OGDF-TEST', 'templateFiltersFile')

print('Generating config_autogen.h ...')
config_autogen = open('include\\ogdf\\internal\\config_autogen.h','w')
config_autogen.write('//\n')
config_autogen.write('// This file has been automatically generated by makeVCXProj.py\n')
config_autogen.write('//\n')
config_autogen.write('// Do not change this file manually, instead reconfigure OGDF!\n')
config_autogen.write('\n')
config_autogen.write(config_defines)
config_autogen.write('\n#ifndef _WIN32_WINNT\n')
config_autogen.write('#define _WIN32_WINNT ' + windowsVersion + '\n')
config_autogen.write('#endif\n')
config_autogen.close()

addIncludes = addIncludes[:-1]
libraryTypeTag = '<<LIBRARYTYPETAG>>'
defineTag = '<<DEFINETAG>>'
includeTag = '<<INCLUDETAG>>'
linkTagD32 = '<<LINKTAGD32>>'
linkTagR32 = '<<LINKTAGR32>>'
linkTagD64 = '<<LINKTAGD64>>'
linkTagR64 = '<<LINKTAGR64>>'
filtersTag = '<<FTAG>>'
openMPTag = '<<OPENMPTAG>>'
toolsetTag = '<<TOOLSET>>'

# Params are:
# - Tag in template-File
# - Directory to start search & subfilters from
# - File Patterns
cppStuff = stuff( '<<CPPTAG>>', 'src\\ogdf', [ '*.c', '*.cpp' ], 'ClCompile', 'Source Files' )
hStuff = stuff( '<<HTAG>>', 'include\\ogdf', [ '*.h', '*.inc' ], 'ClInclude', 'Header Files' )
hLegacyStuff = stuff( '<<HLEGACYTAG>>', 'include\\ogdf_legacy', [ '*.h' ], 'ClInclude', 'Header Files Legacy' )
ogdfStuff = [ cppStuff, hStuff, hLegacyStuff ]

cppCoinStuff = stuff( '<<CPPTAG>>', 'src\\coin', [ '*.c', '*.cpp' ], 'ClCompile', 'Source Files' )
hCoinStuff = stuff( '<<HTAG>>', 'include\\coin', [ '*.h', '*.hpp' ], 'ClInclude', 'Header Files' )
coinStuff = [ cppCoinStuff, hCoinStuff ]

cppTestStuff = stuff( '<<CPPTAG>>', 'test', [ '*.c', '*.cpp' ], 'ClCompile', 'Source Files' )
hTestStuff = stuff( '<<HTAG>>', 'test', [ '*.h', '*.hpp' ], 'ClInclude', 'Header Files' )
testStuff = [ cppTestStuff, hTestStuff ]

#########################################################
#########################################################
## only code below...

# just the def. nothing happens yet
def Walk( curdir, pats, command ):
	names = os.listdir( curdir)
	names.sort()

	for name in names:
		# OGDF ignores
		if name.startswith('.') or name.startswith('_') or (name=='legacy' and not includeLegacyCode):
			continue
		# COIN ignores
		if (name == 'OsiCpxSolverInterface.cpp' or name == 'OsiCpxSolverInterface.hpp') and not addOsiCpx:
			continue
		if (name == 'OsiGrbSolverInterface.cpp' or name == 'OsiGrbSolverInterface.hpp') and not addOsiGrb:
			continue

		outpath = curdir + '\\' + name
		fullname = os.path.normpath(outpath)

		if os.path.isdir(fullname) and not os.path.islink(fullname):
			if name != 'abacus' or useCoin == True:
				Walk( outpath, pats, command)
		else:
			for pat in pats:
				if fnmatch.fnmatch(name, pat):
					vcxproj.write('    <' + command + ' Include="' + outpath + '" />\n')

def WalkFilterFiles( curdir, pats, command, filter ):
	names = os.listdir( curdir)
	names.sort()

	for name in names:
		# OGDF ignores
		if name.startswith('.') or name.startswith('_') or (name=='legacy' and not includeLegacyCode):
			continue
		# COIN ignores
		if (name == 'OsiCpxSolverInterface.cpp' or name == 'OsiCpxSolverInterface.h') and not addOsiCpx:
			continue
		if (name == 'OsiGrbSolverInterface.cpp' or name == 'OsiGrbSolverInterface.h') and not addOsiGrb:
			continue

		outpath = curdir + '\\' + name
		fullname = os.path.normpath(outpath)

		if os.path.isdir(fullname) and not os.path.islink(fullname):
			WalkFilterFiles( outpath, pats, command, filter + '\\' + name )
		else:
			for pat in pats:
				if fnmatch.fnmatch(name, pat):
					vcxfilters.write('    <' + command + ' Include="' + outpath + '">\n')
					vcxfilters.write('      <Filter>' + filter + '</Filter>\n')
					vcxfilters.write('    </' + command + '>\n')

def WalkFilters( curdir, filter ):
	names = os.listdir( curdir)
	names.sort()

	for name in names:
		if name.startswith('.') or name.startswith('_') or (name=='legacy' and not includeLegacyCode):
			continue

		outpath = curdir + '\\' + name
		fullname = os.path.normpath(outpath)

		if os.path.isdir(fullname) and not os.path.islink(fullname):
			if name != 'abacus' or useCoin == True:
				filtername = filter + '\\' + name
				vcxfilters.write('    <Filter Include="' + filtername + '">\n')
				vcxfilters.write('    </Filter>\n')
				WalkFilters( outpath, filtername )


##########################################
## Main below...

print('Generating OGDF VCXProj...', end='')

includeLegacyCode = 0;
if len(sys.argv)>1 and sys.argv[1]=='legacy':
	includeLegacyCode = 1
	print('(including legacy code)...'),

vcxproj = open(filename_vcxproj,'w')
template = open(filename_template)

check = 0
for line in template:
	if check < len(ogdfStuff) and line.find(ogdfStuff[check].tag) > -1:
		if (ogdfStuff[check].tag!='<<HLEGACYTAG>>' or includeLegacyCode):
			Walk(ogdfStuff[check].path, ogdfStuff[check].pats, ogdfStuff[check].command)
		check = check + 1
	elif line.find(libraryTypeTag) > -1:
		vcxproj.write(line.replace(libraryTypeTag,libraryType,1))
	elif line.find(openMPTag) > -1:
		vcxproj.write(line.replace(openMPTag,ogdfOpenMP,1))
	elif line.find(defineTag) > -1:
		vcxproj.write(line.replace(defineTag,addDefines,1))
	elif line.find(includeTag) > -1:
		vcxproj.write(line.replace(includeTag,addIncludes,1))
	elif line.find(linkTagD32) > -1:
		vcxproj.write(line.replace(linkTagD32,linkSectionD32,1))
	elif line.find(linkTagR32) > -1:
		vcxproj.write(line.replace(linkTagR32,linkSectionR32,1))
	elif line.find(linkTagD64) > -1:
		vcxproj.write(line.replace(linkTagD64,linkSectionD64,1))
	elif line.find(linkTagR64) > -1:
		vcxproj.write(line.replace(linkTagR64,linkSectionR64,1))
	elif line.find(toolsetTag) > -1:
		vcxproj.write(line.replace(toolsetTag,platformToolset,1))
	else:
		vcxproj.write(line)

template.close()
vcxproj.close()

# Creation of filters file...

vcxfilters = open(filename_vcxfilters,'w')
template_filters = open(filename_template_filters)

check = 0
for line in template_filters:
	if check < len(ogdfStuff) and line.find(ogdfStuff[check].tag) > -1:
		if (ogdfStuff[check].tag!='<<HLEGACYTAG>>' or includeLegacyCode):
			WalkFilterFiles(ogdfStuff[check].path, ogdfStuff[check].pats, ogdfStuff[check].command, ogdfStuff[check].filter)
		check = check + 1
	elif line.find(filtersTag) > -1:
		for s in ogdfStuff:
			if (s.tag!='<<HLEGACYTAG>>' or includeLegacyCode):
				WalkFilters(s.path, s.filter)
	else:
		vcxfilters.write(line)

template_filters.close()
vcxfilters.close()

print('done')

if useCoin:
	print ('Generating COIN VCXProj...', end='')

	vcxproj = open(filename_coin_vcxproj,'w')
	template = open(filename_coin_template)

	check = 0
	for line in template:
		if check < len(coinStuff) and line.find(coinStuff[check].tag) > -1:
			Walk(coinStuff[check].path, coinStuff[check].pats, coinStuff[check].command)
			check = check + 1
		elif line.find(openMPTag) > -1:
			vcxproj.write(line.replace(openMPTag,coinOpenMP,1))
		elif line.find(includeTag) > -1:
			vcxproj.write(line.replace(includeTag,addIncludes,1))
		elif line.find(toolsetTag) > -1:
			vcxproj.write(line.replace(toolsetTag,platformToolset,1))
		else:
			vcxproj.write(line)

	template.close()
	vcxproj.close()

	# Creation of filters file...

	vcxfilters = open(filename_coin_vcxfilters,'w')
	template_filters = open(filename_coin_template_filters)

	check = 0
	for line in template_filters:
		if check < len(coinStuff) and line.find(coinStuff[check].tag) > -1:
			WalkFilterFiles(coinStuff[check].path, coinStuff[check].pats, coinStuff[check].command, coinStuff[check].filter)
			check = check + 1
		elif line.find(filtersTag) > -1:
			for s in coinStuff:
				WalkFilters(s.path, s.filter)
		else:
			vcxfilters.write(line)

	template_filters.close()
	vcxfilters.close()

	print ('done')

print ('Generating OGDF-TEST VCXProj...', end='')

vcxproj = open(filename_ogdf_test_vcxproj,'w')
template = open(filename_ogdf_test_template)

check = 0
for line in template:
	if check < len(testStuff) and line.find(testStuff[check].tag) > -1:
		Walk(testStuff[check].path, testStuff[check].pats, testStuff[check].command)
		check = check + 1
	elif line.find(includeTag) > -1:
		vcxproj.write(line.replace(includeTag,addIncludes,1))
	elif line.find(linkTagD32) > -1:
		vcxproj.write(line.replace(linkTagD32,linkSectionProgramD32,1))
	elif line.find(linkTagR32) > -1:
		vcxproj.write(line.replace(linkTagR32,linkSectionProgramR32,1))
	elif line.find(linkTagD64) > -1:
		vcxproj.write(line.replace(linkTagD64,linkSectionProgramD64,1))
	elif line.find(linkTagR64) > -1:
		vcxproj.write(line.replace(linkTagR64,linkSectionProgramR64,1))
	elif line.find(toolsetTag) > -1:
		vcxproj.write(line.replace(toolsetTag,platformToolset,1))
	else:
		vcxproj.write(line)

template.close()
vcxproj.close()

# Creation of filters file...

vcxfilters = open(filename_ogdf_test_vcxfilters,'w')
template_filters = open(filename_ogdf_test_template_filters)

check = 0
for line in template_filters:
	if check < len(testStuff) and line.find(testStuff[check].tag) > -1:
		WalkFilterFiles(testStuff[check].path, testStuff[check].pats, testStuff[check].command, testStuff[check].filter)
		check = check + 1
	elif line.find(filtersTag) > -1:
		for s in testStuff:
			WalkFilters(s.path, s.filter)
	else:
		vcxfilters.write(line)

template_filters.close()
vcxfilters.close()

print ('done')

if createSolution:
	print ('Generating Solution...', end='')

	GUID_sln = '{0F7C385F-D08C-494E-8715-70CD736C75B2}'
	GUID_ogdf = '{7801D1BE-E2FE-476B-A4B4-5D27F387F479}'
	GUID_coin = '{FB212DCC-D374-430B-B594-5CEC25BC7A75}'
	GUID_ogdf_test = '{278A54D6-588A-4110-9E44-DA24DB9D5E85}'

	Configurations = [ 'Debug', 'Release' ]
	Platforms = [ 'Win32', 'x64' ]

	sln = open(filename_sln, 'w')
	sln.write('Microsoft Visual Studio Solution File, Format Version 11.00\n')
	
	sln.write('Project("' + GUID_sln + '") = "ogdf-test", "' + filename_ogdf_test_vcxproj + '", "' + GUID_ogdf_test + '"\n')
	sln.write('\tProjectSection(ProjectDependencies) = postProject\n')
	sln.write('\t\t' + GUID_ogdf + ' = ' + GUID_ogdf + '\n')
	if useCoin:
		sln.write('\t\t' + GUID_coin + ' = ' + GUID_coin + '\n')
	sln.write('\tEndProjectSection\n')
	sln.write('EndProject\n')

	sln.write('Project("' + GUID_sln + '") = "ogdf", "' + filename_vcxproj + '", "' + GUID_ogdf + '"\n')
	if createDLL and createDLL.startswith('t') and useCoin:
		sln.write('\tProjectSection(ProjectDependencies) = postProject\n')
		sln.write('\t\t' + GUID_coin + ' = ' + GUID_coin + '\n')
		sln.write('\tEndProjectSection\n')
	sln.write('EndProject\n')

	if useCoin:
		sln.write('Project("' + GUID_sln + '") = "coin", "' + filename_coin_vcxproj + '", "' + GUID_coin + '"\n')
		sln.write('EndProject\n')

	sln.write('Global\n')
	sln.write('\tGlobalSection(SolutionConfigurationPlatforms) = preSolution\n')
	sln.write('\t\tDebug|Win32 = Debug|Win32\n')
	sln.write('\t\tDebug|x64 = Debug|x64\n')
	sln.write('\t\tRelease|Win32 = Release|Win32\n')
	sln.write('\t\tRelease|x64 = Release|x64\n')
	sln.write('\tEndGlobalSection\n')
	sln.write('\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n')

	if useCoin:
		projectGUIDs = [ GUID_ogdf, GUID_coin, GUID_ogdf_test ]
	else:
		projectGUIDs = [ GUID_ogdf, GUID_ogdf_test ]
	for g in projectGUIDs:
		for c in Configurations:
			for p in Platforms:
				sln.write('\t\t' + g + '.' + c + '|' + p + '.ActiveCfg' + ' = ' + c + '|' + p + '\n')
				sln.write('\t\t' + g + '.' + c + '|' + p + '.Build.0' + ' = ' + c + '|' + p + '\n')
	sln.write('\tEndGlobalSection\n')
	sln.write('\tGlobalSection(SolutionProperties) = preSolution\n')
	sln.write('\t\tHideSolutionNode = FALSE\n')
	sln.write('\tEndGlobalSection\n')
	sln.write('EndGlobal\n')

	sln.close()
	print ('done')