Use Python 3 for the quick start scripts

feature/quick-start-py
kaetemi 3 years ago
parent ceb10c3d21
commit 730d174f39
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -1,5 +1,5 @@
from common_config import *
from . common_config import *
import os

@ -1,5 +1,5 @@
from common_root import *
from .common_root import *
import os, json, socket

@ -0,0 +1,5 @@
# This generates the build scripts for all targets
# end of file

@ -1,9 +1,12 @@
# This script generates a configuration file listing all the available toolchains
from common import *
from find_vstudio import *
from find_external import *
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from quick_start.common import *
from quick_start.find_vstudio import *
from quick_start.find_external import *
Toolchains = {}
@ -36,8 +39,26 @@ for ts in SortedToolsets:
if not len(toolchain["Prefix"]) and vs["Version"] >= 14:
toolchain["Hunter"] = True
toolchain["CMake"] = []
if vs["Version"] < 14:
toolchain["CMake"] += [ "-DWINSDK_VERSION=6.0A" ]
# Set the SDK version
# https://en.wikipedia.org/wiki/Microsoft_Windows_SDK
# C:\Program Files (x86)\Windows Kits\10
if vs["Version"] < 14 and not ts.endswith("_xp"):
if vs["Version"] >= 12: # 2013
toolchain["CMake"] += [ "-DWINSDK_VERSION=8.1A" ]
elif vs["Version"] >= 11: # 2012
toolchain["CMake"] += [ "-DWINSDK_VERSION=8.0A" ]
elif vs["Version"] >= 10: # 2010
toolchain["CMake"] += [ "-DWINSDK_VERSION=7.0A" ]
elif vs["Version"] >= 9:
# C:\Program Files\Microsoft SDKs\Windows\v6.0A
if os.path.isfile("C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Include\\Msi.h"):
toolchain["CMake"] += [ "-DWINSDK_DIR=C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A" ]
toolchain["CMake"] += [ "-DWINSDK_VERSION=6.0A" ]
else:
# C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
if os.path.isfile("C:\\Program Files\\Microsoft Platform SDK for Windows Server 2003 R2\\Include\\Msi.h"):
toolchain["CMake"] += [ "-DWINSDK_DIR=C:/Program Files/Microsoft Platform SDK for Windows Server 2003 R2" ]
toolchain["CMake"] += [ "-DWINSDK_VERSION=5.2" ]
toolchain["EnvPath"] = FindBinPaths(toolchain["Prefix"])
toolchain["EnvSet"] = []
# For XP support, simply target SDK 7.1A
@ -97,6 +118,8 @@ for ts in SortedToolsets:
copyToolchain["Prefix"] = []
copyToolchain["EnvPath"] = []
copyToolchain["EnvSet"] += [ "CL=/DLIBXML_STATIC;%CL%" ]
if "LuaVersion" in copyToolchain:
del copyToolchain["LuaVersion"]
Toolchains[toolchain["OS"] + "/VS/" + ts + "/" + platform + "/H"] = copyToolchain
with open(os.path.join(NeLConfigDir, "toolchains_" + socket.gethostname().lower() + "_default.json"), 'w') as fo:

@ -2,7 +2,7 @@
# This script detects all external library paths
# Useful for locating all dynamic libraries
from common_config import *
from .common_config import *
import os

@ -2,12 +2,13 @@
# Script finds latest max installation, user directory, and max SDKs
import os
from itertools import chain
def HasPluginMax(path):
return os.path.isfile(os.path.join(path, "3dsmax.exe")) and (os.path.isfile(os.path.join(path, "plugins/nelexport_r.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport_d.dlu")) or os.path.isfile(os.path.join(path, "plugins/nelexport.dlu")))
def FindPluginMax():
for i in range(2038, 2007, -1) + range(9, 2, -1):
for i in chain(range(2038, 2007, -1), range(9, 2, -1)):
path = os.getenv('ADSK_3DSMAX_x64_' + str(i))
if path and HasPluginMax(path):
return os.path.normpath(path)
@ -19,7 +20,7 @@ def FindPluginMax():
return os.path.normpath(path)
def FindLatestMax():
for i in range(2038, 2007, -1) + range(9, 2, -1):
for i in chain(range(2038, 2007, -1), range(9, 2, -1)):
path = os.getenv('ADSK_3DSMAX_x64_' + str(i))
if path and os.path.isfile(os.path.join(path, "3dsmax.exe")):
return os.path.normpath(path)
@ -101,7 +102,7 @@ def FindMaxSDKs():
res = []
set = {}
remap = {}
for i in range(3, 10) + range(2008, 2039):
for i in chain(range(3, 10), range(2008, 2039)):
found = FindMaxSDK(i)
if found:
set[i] = True

@ -0,0 +1,33 @@
from .find_toolchain import *
from .find_max import *
NeLTargetClientDev = FindToolchainEx(NeLToolchainNative)
NeLTargetServerDev = FindToolchainEx(NeLToolchainNative)
NeLTargetClient = {}
for client in NeLConfig["Toolchain"]["Client"]:
NeLTargetClient[client] = FindToolchainEx(NeLConfig["Toolchain"]["Client"][client])
NeLTargetServer = FindToolchainEx(NeLConfig["Toolchain"]["Server"])
NeLTargetTools = FindToolchainEx(NeLToolchainNative)
NeLTargetSamples = FindToolchainEx(NeLToolchainNative)
NelTargetPluginMax = {}
remapMaxCompatible = {}
foundMax = {}
for maxSdk in FoundMaxSDKs:
if "Compatible" in maxSdk:
# Skip unnecessary builds
if maxSdk["Compatible"] in foundMax:
continue
filters = [ { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True, "Hunter": True }, { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True } ]
foundTs = FindToolchainEx(filters)
if foundTs:
foundMax[maxSdk["Version"]] = True
if "Compatible" in maxSdk:
foundMax[maxSdk["Compatible"]] = True
NelTargetPluginMax[str(maxSdk["Version"]) + "_" + maxSdk["Platform"]] = foundTs
del filters
del foundTs
del remapMaxCompatible
del foundMax
# end of file

@ -1,7 +1,7 @@
# This script finds the best toolchains for each purpose
from common import *
from .common import *
def FindToolchain(filter):
toolchains = {}

@ -1,9 +1,10 @@
from find_toolchain import *
from find_max import *
import sys, os
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
def printBuildTarget(name, filters):
tn = FindToolchainEx(filters)
from quick_start.find_targets import *
def printBuildTarget(name, tn):
if tn:
tc = NeLToolchains[tn]
withHunter = ""
@ -14,26 +15,14 @@ def printBuildTarget(name, filters):
print(" " + name + ": NOT FOUND")
print("Build targets:")
printBuildTarget("client_dev", NeLToolchainNative)
printBuildTarget("server_dev", NeLToolchainNative)
for client in NeLConfig["Toolchain"]["Client"]:
printBuildTarget(client, NeLConfig["Toolchain"]["Client"][client])
printBuildTarget("server", NeLConfig["Toolchain"]["Server"])
printBuildTarget("tools", NeLToolchainNative)
printBuildTarget("samples", NeLToolchainNative)
remapMaxCompatible = {}
foundMax = {}
for maxSdk in FoundMaxSDKs:
if "Compatible" in maxSdk:
# Skip unnecessary builds
if maxSdk["Compatible"] in foundMax:
continue
filters = [ { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True, "Hunter": True }, { "Toolset": maxSdk["Toolset"], "Platform": maxSdk["Platform"], "HasMFC": True } ]
if FindToolchainEx(filters):
foundMax[maxSdk["Version"]] = True
if "Compatible" in maxSdk:
foundMax[maxSdk["Compatible"]] = True
printBuildTarget("plugin_max/" + str(maxSdk["Version"]) + "_" + maxSdk["Platform"], filters)
# plugin_max
printBuildTarget("client_dev", NeLTargetClientDev)
printBuildTarget("server_dev", NeLTargetServerDev)
for client in NeLTargetClient:
printBuildTarget(client, NeLTargetClient[client])
printBuildTarget("server", NeLTargetServer)
printBuildTarget("tools", NeLTargetTools)
printBuildTarget("samples", NeLTargetSamples)
for pluginMax in NelTargetPluginMax:
printBuildTarget("plugin_max/" + pluginMax, NelTargetPluginMax[pluginMax])
# end of file

@ -1,4 +1,4 @@
..\..\..\external\python27\python.exe configure_toolchains.py
..\..\..\external\python27\python.exe find_toolchain.py
..\..\..\external\python27\python.exe find_max.py
..\..\..\external\python27\python.exe print_summary.py
rem ..\..\..\external\python3\python.exe configure_toolchains.py
rem ..\..\..\external\python3\python.exe find_toolchain.py
rem ..\..\..\external\python3\python.exe find_max.py
..\..\..\external\python3\python.exe print_summary.py

Loading…
Cancel
Save