forked from zooba/ogre3d-python-embed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
python.props
65 lines (60 loc) · 5.22 KB
/
python.props
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
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="ShowPythonInfo" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PythonCompany Condition="$(PythonCompany) == ''">PythonCore</PythonCompany>
<PythonTag Condition="$(PythonTag) == '' and $(Platform) != 'x64'">3.6-32</PythonTag>
<PythonTag Condition="$(PythonTag) == '' and $(Platform) == 'x64'">3.6</PythonTag>
</PropertyGroup>
<!--
Inspect the registry to discover an installation of the requested runtime.
-->
<PropertyGroup Label="PythonConfiguration">
<_RegistryView>RegistryView.Registry32</_RegistryView>
<_RegistryView Condition="$(Platform) == 'x64'">RegistryView.Registry64</_RegistryView>
<PythonHome Condition="$(PythonHome) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Python\$(PythonCompany)\$(PythonTag)\InstallPath', null, null, $(_RegistryView)))</PythonHome>
<PythonHome Condition="$(PythonHome) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Python\$(PythonCompany)\$(PythonTag)\InstallPath', null, null, $(_RegistryView)))</PythonHome>
<PythonExe Condition="$(PythonExe) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Python\$(PythonCompany)\$(PythonTag)\InstallPath', 'ExecutablePath', null, $(_RegistryView)))</PythonExe>
<PythonExe Condition="$(PythonExe) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Python\$(PythonCompany)\$(PythonTag)\InstallPath', 'ExecutablePath', null, $(_RegistryView)))</PythonExe>
<PythonExe Condition="$(PythonExe) == '' and $(PythonHome) != ''">$(PythonHome)python.exe</PythonExe>
<PythonDevVersion>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'dev', null, $(_RegistryView)))</PythonDevVersion>
<PythonDevVersion Condition="$(PythonDevVersion) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'dev', null, $(_RegistryView)))</PythonDevVersion>
<PythonCorePDBVersion>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'core_pdb', null, $(_RegistryView)))</PythonCorePDBVersion>
<PythonCorePDBVersion Condition="$(PythonCorePDBVersion) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'core_pdb', null, $(_RegistryView)))</PythonCorePDBVersion>
<PythonCoreDVersion>$([MSBuild]::GetRegistryValueFromView('HKEY_CURRENT_USER\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'core_d', null, $(_RegistryView)))</PythonCoreDVersion>
<PythonCoreDVersion Condition="$(PythonCoreDVersion) == ''">$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\$(PythonTag)\InstalledFeatures', 'core_d', null, $(_RegistryView)))</PythonCoreDVersion>
<PythonDebugSuffix Condition="$(PythonCoreDVersion) != ''">_d</PythonDebugSuffix>
<PythonDExe Condition="$(PythonExe) != '' and $(PythonDExe) == ''">$([System.IO.Path]::GetDirectoryName($(PythonExe)))\python$(PythonDebugSuffix).exe</PythonDExe>
<PythonDExe Condition="!Exists($(PythonDExe))">$(PythonExe)</PythonDExe>
</PropertyGroup>
<PropertyGroup Condition="$(PythonHome) != '' and $(PythonDevVersion) != ''">
<PythonInclude Condition="Exists('$(PythonHome)include')">$(PythonHome)include</PythonInclude>
<PythonLibs Condition="Exists('$(PythonHome)libs')">$(PythonHome)libs</PythonLibs>
</PropertyGroup>
<!--
Add the discovered paths to our configuration.
For debug builds without debug Python binaries, change the runtime library
to ensure compatibility.
-->
<ItemDefinitionGroup Condition="$(PythonHome) != ''">
<ClCompile>
<AdditionalIncludeDirectories Condition="$(PythonInclude) != ''">$(PythonInclude);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary Condition="$(Configuration) == 'Debug' and $(PythonCoreDVersion) == ''">MultithreadedDLL</RuntimeLibrary>
</ClCompile>
<Link Condition="$(PythonLibs) != ''">
<AdditionalLibraryDirectories>$(PythonLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<!--
The ShowPythonInfo target displays messages for the runtime we have discovered.
-->
<Target Name="_ShowPythonInfo" Condition="$(PythonHome) != '' and $(PythonDevVersion) != ''">
<Message Text="Using Python $(PythonTag) found at $(PythonHome)" Importance="normal" />
<Message Text=" - includes from $(PythonInclude)" Importance="normal" />
<Message Text=" - libs from $(PythonLibs)" Importance="normal" />
</Target>
<Target Name="_ShowPythonMissing" Condition="$(PythonHome) == '' or $(PythonDevVersion) == ''">
<Message Text="Searched for Python $(PythonTag) for platform $(Platform) but did not find any." Importance="high" Condition="$(PythonHome) == ''" />
<Message Text="Found Python $(PythonTag) at $(PythonHome) but headers and libraries were missing." Importance="high" Condition="$(PythonHome) != ''" />
</Target>
<Target Name="ShowPythonInfo" BeforeTargets="PrepareForBuild" DependsOnTargets="_ShowPythonInfo;_ShowPythonMissing" />
</Project>