mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 12:37:51 +02:00
Merge pull request #813 from daleglass-overte/get-vcpkg-path
Add a way to get VCPKG path and hash ID
This commit is contained in:
commit
1221b46a59
3 changed files with 42 additions and 17 deletions
|
@ -81,6 +81,8 @@ endif()
|
||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
system_qt = True
|
system_qt = True
|
||||||
|
|
||||||
|
if not self.args.quiet:
|
||||||
print("Using system Qt")
|
print("Using system Qt")
|
||||||
|
|
||||||
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
elif os.getenv('OVERTE_QT_PATH', "") != "":
|
||||||
|
@ -92,6 +94,8 @@ endif()
|
||||||
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
|
||||||
|
|
||||||
qt_found = True
|
qt_found = True
|
||||||
|
|
||||||
|
if not self.args.quiet:
|
||||||
print("Using Qt from " + self.fullPath)
|
print("Using Qt from " + self.fullPath)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
@ -135,6 +139,7 @@ endif()
|
||||||
self.lockFile = os.path.join(lockDir, lockName)
|
self.lockFile = os.path.join(lockDir, lockName)
|
||||||
|
|
||||||
if qt_found:
|
if qt_found:
|
||||||
|
if not self.args.quiet:
|
||||||
print("Found pre-built Qt5")
|
print("Found pre-built Qt5")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
|
@ -71,6 +71,7 @@ endif()
|
||||||
os.makedirs(self.basePath)
|
os.makedirs(self.basePath)
|
||||||
self.path = os.path.join(self.basePath, self.id)
|
self.path = os.path.join(self.basePath, self.id)
|
||||||
|
|
||||||
|
if not self.args.quiet:
|
||||||
print("Using vcpkg path {}".format(self.path))
|
print("Using vcpkg path {}".format(self.path))
|
||||||
lockDir, lockName = os.path.split(self.path)
|
lockDir, lockName = os.path.split(self.path)
|
||||||
lockName += '.lock'
|
lockName += '.lock'
|
||||||
|
|
21
prebuild.py
21
prebuild.py
|
@ -83,6 +83,10 @@ def parse_args():
|
||||||
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
parser.add_argument('--build-root', required=True, type=str, help='The location of the cmake build')
|
||||||
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
parser.add_argument('--ports-path', type=str, default=defaultPortsPath)
|
||||||
parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
|
parser.add_argument('--ci-build', action='store_true', default=os.getenv('CI_BUILD') is not None)
|
||||||
|
parser.add_argument('--get-vcpkg-id', action='store_true', help='Get the VCPKG ID, the hash path of the full VCPKG path')
|
||||||
|
parser.add_argument('--get-vcpkg-path', action='store_true', help='Get the full VCPKG path, ID included.')
|
||||||
|
parser.add_argument('--quiet', action='store_true', default=False, help='Quiet mode with less output')
|
||||||
|
|
||||||
if True:
|
if True:
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
else:
|
else:
|
||||||
|
@ -99,6 +103,10 @@ def main():
|
||||||
del os.environ[var]
|
del os.environ[var]
|
||||||
|
|
||||||
args = parse_args()
|
args = parse_args()
|
||||||
|
|
||||||
|
if not args.quiet:
|
||||||
|
print(sys.argv)
|
||||||
|
|
||||||
assets_url = hifi_utils.readEnviromentVariableFromFile(args.build_root, 'EXTERNAL_BUILD_ASSETS')
|
assets_url = hifi_utils.readEnviromentVariableFromFile(args.build_root, 'EXTERNAL_BUILD_ASSETS')
|
||||||
|
|
||||||
if args.ci_build:
|
if args.ci_build:
|
||||||
|
@ -129,11 +137,22 @@ def main():
|
||||||
qt.writeConfig()
|
qt.writeConfig()
|
||||||
else:
|
else:
|
||||||
if (os.environ["OVERTE_USE_SYSTEM_QT"]):
|
if (os.environ["OVERTE_USE_SYSTEM_QT"]):
|
||||||
|
if not args.quiet:
|
||||||
print("System Qt selected")
|
print("System Qt selected")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
raise Exception("Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path")
|
raise Exception("Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path")
|
||||||
|
|
||||||
pm = hifi_vcpkg.VcpkgRepo(args)
|
pm = hifi_vcpkg.VcpkgRepo(args)
|
||||||
|
|
||||||
|
if args.get_vcpkg_id:
|
||||||
|
print(pm.id)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
|
if args.get_vcpkg_path:
|
||||||
|
print(pm.path)
|
||||||
|
exit(0)
|
||||||
|
|
||||||
if qtInstallPath is not None:
|
if qtInstallPath is not None:
|
||||||
pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)
|
pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)
|
||||||
|
|
||||||
|
@ -190,7 +209,7 @@ def main():
|
||||||
|
|
||||||
logger.info('end')
|
logger.info('end')
|
||||||
|
|
||||||
print(sys.argv)
|
|
||||||
try:
|
try:
|
||||||
main()
|
main()
|
||||||
except hifi_utils.SilentFatalError as fatal_ex:
|
except hifi_utils.SilentFatalError as fatal_ex:
|
||||||
|
|
Loading…
Reference in a new issue