init
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.21005.1
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SDK", "SDK", "{10313F85-EFD9-42AB-BF90-643A406FDD99}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Designer", "Designer", "{EEB9310A-3238-432D-9EAD-CDFCB35054D4}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extras", "Extras", "{3F5EF7F3-0F10-4F2E-ACEB-3B1326E3DA48}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Designer-Extras", "designer-extras.vcxproj", "{C003281C-E8FC-49FE-8B50-37A6035730D7}"
|
||||
EndProject
|
||||
{%- for project in proj_list %}
|
||||
{{ project }}
|
||||
{%- endfor %}
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|{{ platform_target }} = Debug|{{ platform_target }}
|
||||
MinSizeRel|{{ platform_target }} = MinSizeRel|{{ platform_target }}
|
||||
Release|{{ platform_target }} = Release|{{ platform_target }}
|
||||
RelWithDebInfo|{{ platform_target }} = RelWithDebInfo|{{ platform_target }}
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{# #}
|
||||
{%- for project in proj_conf_platforms %}
|
||||
{{- project -}}
|
||||
{% endfor -%}
|
||||
{# #} EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{%- for key, val in nested_projs.items() %}
|
||||
{{ "{" }}{{ key }}{{ "}" }} = {{ "{" }}{{ val }}{{ "}" -}}
|
||||
{%- endfor %}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,71 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|{{ platform_target }}">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>{{ platform_target }}</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|{{ platform_target }}">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>{{ platform_target }}</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{C003281C-E8FC-49FE-8B50-37A6035730D7}</ProjectGuid>
|
||||
<RootNamespace>designerextras</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|{{ platform_target }}'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|{{ platform_target }}'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|{{ platform_target }}'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|{{ platform_target }}'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|{{ platform_target }}'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|{{ platform_target }}'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
+101
@@ -0,0 +1,101 @@
|
||||
#!/usr/local/bin/python
|
||||
|
||||
import re
|
||||
import sys
|
||||
from os.path import join as joinpath, split as splitpath, exists as existspath, normpath, dirname, abspath, relpath, realpath
|
||||
import jinja2
|
||||
import argparse
|
||||
|
||||
def render(tpl_path, context):
|
||||
path, filename = splitpath(tpl_path)
|
||||
return jinja2.Environment(loader=jinja2.FileSystemLoader(path or './')).get_template(filename).render(context).replace(u'\ufeff', '')
|
||||
|
||||
def renderToFile(outfile, tpl_path, context) :
|
||||
res = render(tpl_path, context)
|
||||
with open(outfile, "w") as f:
|
||||
f.write(res)
|
||||
|
||||
def getContent(file, endKeyword) :
|
||||
res = []
|
||||
for line in file :
|
||||
if line == endKeyword :
|
||||
break
|
||||
res.append(line)
|
||||
return res
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
#Arguments handling
|
||||
parser = argparse.ArgumentParser(description='Generate merged Visual Studio project for OpenViBE')
|
||||
parser.add_argument('-o', '--outsln', type=str, default="OpenViBE-Meta.sln", help='Output SLN file')
|
||||
parser.add_argument('-b', '--builddir', type=str, default="build", help='Build directory where Visual Studio Solutions are located')
|
||||
parser.add_argument('-p', '--platformtarget', type=str, default="x86", help='x86 or x64')
|
||||
args = parser.parse_args()
|
||||
build_dir = abspath(args.builddir)
|
||||
platform_target = args.platformtarget
|
||||
dist_dir = joinpath(dirname(build_dir), 'dist')
|
||||
outfile = args.outsln
|
||||
script_dir = dirname(realpath(__file__))
|
||||
slntpl_path = joinpath(script_dir, "OpenViBE-Meta.sln-tpl")
|
||||
usertpl_path = joinpath(script_dir, "vcxproj.user-tpl")
|
||||
designerex_path = joinpath(script_dir, "designer-extras.vcxproj-tpl")
|
||||
|
||||
if platform_target == "x64" :
|
||||
platform_vs_target = "x64"
|
||||
else:
|
||||
platform_vs_target = "Win32"
|
||||
|
||||
context = { 'proj_list' : [], 'proj_conf_platforms' : [], 'nested_projs' : {}, 'platform_target' : platform_vs_target }
|
||||
projects = [
|
||||
('SDK', "10313F85-EFD9-42AB-BF90-643A406FDD99", normpath(joinpath(build_dir, "sdk-" + platform_target , "OpenVIBE.sln"))),
|
||||
("Designer", "EEB9310A-3238-432D-9EAD-CDFCB35054D4", normpath(joinpath(build_dir, "designer-" + platform_target, "Designer.sln"))),
|
||||
("Extras", "3F5EF7F3-0F10-4F2E-ACEB-3B1326E3DA48", normpath(joinpath(build_dir, "extras-" + platform_target, "OpenVIBE.sln")))]
|
||||
build_types = ['Debug', 'Release', 'MinSizeRel', 'RelWithDebInfo']
|
||||
|
||||
# Generate config file for designer-extras project
|
||||
ov_env = { type : (joinpath(dist_dir, "extras-" + platform_target, type, "bin", "openvibe-designer.exe"), 'OV_PATH_ROOT=' + joinpath(dist_dir, "extras-" + platform_target, type)) for type in build_types}
|
||||
renderToFile(joinpath(build_dir, "designer-extras.vcxproj"), designerex_path, { 'platform_target' : platform_vs_target } )
|
||||
renderToFile(joinpath(build_dir, "designer-extras.vcxproj.user"), usertpl_path, { 'configurations' : ov_env, 'platform_target' : platform_vs_target } )
|
||||
|
||||
for folderName, folderId, path_sln in projects :
|
||||
pathprefix = relpath(dirname(path_sln), normpath(dirname(abspath(outfile))))
|
||||
# Sets the correct value for OV_PATH_ROOT; It should be possible to set multiple values separated by newline
|
||||
# Unfortunately due to a bug, this is not always possible, see https://connect.microsoft.com/VisualStudio/feedback/details/727324/msvs10-c-deu-debugger-environment-variables-missing-linefeed
|
||||
# (This is about german VS 2010, but this is also happening on french VS2013)
|
||||
ov_env = { type : (None, 'OV_PATH_ROOT=' + joinpath(dist_dir, folderName.lower() + "-" + platform_target, type.upper())) for type in build_types}
|
||||
if not existspath(path_sln) :
|
||||
print(path_sln, 'does not exist !')
|
||||
continue
|
||||
print('Parsing', path_sln)
|
||||
with open(path_sln, 'r') as f:
|
||||
for line in f :
|
||||
res = re.match('Project\("{([\dABCDEF-]+)}"\)\s+=\s+"([\w\-]+)",\s+"([\w\-\\\.]+)",\s+"{([\dABCDEF\-]+)}"', line)
|
||||
if res :
|
||||
slnId, projectName, projectPath, projectId = res.groups()
|
||||
content = getContent(f, "EndProject\n")
|
||||
newpath = joinpath(pathprefix, projectPath) if len(content) else projectPath
|
||||
tab = ['Project("{%s}") = "%s", "%s", "{%s}"\n' % (slnId, projectName, newpath, projectId)] \
|
||||
+ content \
|
||||
+ ["EndProject"]
|
||||
context['proj_list'].append(''.join(tab))
|
||||
context['nested_projs'][projectId] = folderId
|
||||
# Generate .user file
|
||||
projectfile = joinpath(dirname(path_sln), projectPath)
|
||||
userfile = projectfile + ".user"
|
||||
renderToFile(userfile, usertpl_path, { 'configurations' : ov_env, 'platform_target' : platform_vs_target } )
|
||||
elif line == "Global\n" :
|
||||
for line2 in f :
|
||||
if line2 == "\tGlobalSection(ProjectConfigurationPlatforms) = postSolution\n" :
|
||||
context['proj_conf_platforms'] += getContent(f, "\tEndGlobalSection\n")
|
||||
elif line2 == "\tGlobalSection(NestedProjects) = preSolution\n" :
|
||||
res = getContent(f, "\tEndGlobalSection\n")
|
||||
for item in res :
|
||||
key, val = re.search('{([\dABCDEF-]+)}\s=\s{([\dABCDEF-]+)}', item).groups()
|
||||
context['nested_projs'][key] = val
|
||||
try :
|
||||
renderToFile(outfile, slntpl_path, context)
|
||||
except :
|
||||
print('Could not generate %s' % (outfile,))
|
||||
sys.exit(1)
|
||||
else :
|
||||
print('Project [%s] generated' % (outfile,))
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
{% for config_type, (config_command, config_env) in configurations.items() %}
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='{{ config_type }}|{{ platform_target }}'">
|
||||
{%- if config_command is not none %}
|
||||
<LocalDebuggerCommand>{{ config_command }}</LocalDebuggerCommand>
|
||||
{%- endif -%}
|
||||
{%- if config_env is not none %}
|
||||
<LocalDebuggerEnvironment>{{ config_env }}</LocalDebuggerEnvironment>
|
||||
{%- endif -%}
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
{% endfor %}
|
||||
</Project>
|
||||
Reference in New Issue
Block a user