Add a way to get VCPKG path and hash ID

This commit is contained in:
Dale Glass 2024-02-12 18:24:35 +01:00
parent f9b5c786fb
commit 0e2131e80c
3 changed files with 30 additions and 17 deletions

View file

@ -81,7 +81,7 @@ endif()
qt_found = True
system_qt = True
print("Using system Qt")
#print("Using system Qt")
elif os.getenv('OVERTE_QT_PATH', "") != "":
# 2. Using an user-provided directory.
@ -92,7 +92,7 @@ endif()
self.cmakePath = os.path.join(self.fullPath, 'lib', 'cmake')
qt_found = True
print("Using Qt from " + self.fullPath)
#print("Using Qt from " + self.fullPath)
else:
# 3. Using a pre-built Qt.
@ -135,7 +135,7 @@ endif()
self.lockFile = os.path.join(lockDir, lockName)
if qt_found:
print("Found pre-built Qt5")
#print("Found pre-built Qt5")
return
if 'Windows' == system:

View file

@ -71,7 +71,7 @@ endif()
os.makedirs(self.basePath)
self.path = os.path.join(self.basePath, self.id)
print("Using vcpkg path {}".format(self.path))
#print("Using vcpkg path {}".format(self.path))
lockDir, lockName = os.path.split(self.path)
lockName += '.lock'
if not os.path.isdir(lockDir):

View file

@ -83,6 +83,9 @@ def parse_args():
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('--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.')
if True:
args = parser.parse_args()
else:
@ -129,11 +132,21 @@ def main():
qt.writeConfig()
else:
if (os.environ["OVERTE_USE_SYSTEM_QT"]):
print("System Qt selected")
#print("System Qt selected")
None
else:
raise Exception("Internal error: System Qt not selected, but hifi_qt.py failed to return a cmake path")
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:
pm.writeVar('QT_CMAKE_PREFIX_PATH', qtInstallPath)
@ -190,7 +203,7 @@ def main():
logger.info('end')
print(sys.argv)
#print(sys.argv)
try:
main()
except hifi_utils.SilentFatalError as fatal_ex: