Ready for Mac/Linux testing.

This commit is contained in:
NissimHadar 2019-04-22 17:58:20 -07:00
parent 4b26ef7c0f
commit 24110ebf86
2 changed files with 12 additions and 47 deletions

View file

@ -1,4 +1,3 @@
#
# Created by Bradley Austin Davis on 2017/09/02
# Copyright 2013-2017 High Fidelity, Inc.
#
@ -6,49 +5,18 @@
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
# Construct a default QT location from a root path, a version and an architecture
function(calculate_default_qt_dir _RESULT_NAME)
if (ANDROID)
set(QT_DEFAULT_ARCH "android_armv7")
elseif(UWP)
set(QT_DEFAULT_ARCH "winrt_x64_msvc2017")
elseif(APPLE)
set(QT_DEFAULT_ARCH "clang_64")
elseif(WIN32)
set(QT_DEFAULT_ARCH "msvc2017_64")
else()
set(QT_DEFAULT_ARCH "gcc_64")
endif()
if (WIN32 OR (ANDROID AND ("${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "Windows")))
set(QT_DEFAULT_ROOT "c:/Qt")
else()
set(QT_DEFAULT_ROOT "$ENV{HOME}/Qt")
endif()
set_from_env(QT_ROOT QT_ROOT ${QT_DEFAULT_ROOT})
set_from_env(QT_VERSION QT_VERSION "5.10.1")
set_from_env(QT_ARCH QT_ARCH ${QT_DEFAULT_ARCH})
set(${_RESULT_NAME} "${QT_ROOT}/${QT_VERSION}/${QT_ARCH}" PARENT_SCOPE)
endfunction()
# Sets the QT_CMAKE_PREFIX_PATH and QT_DIR variables
# Also enables CMAKE_AUTOMOC and CMAKE_AUTORCC
macro(setup_qt)
# if QT_CMAKE_PREFIX_PATH was not specified before hand,
# try to use the environment variable
if (NOT QT_CMAKE_PREFIX_PATH)
set(QT_CMAKE_PREFIX_PATH "$ENV{QT_CMAKE_PREFIX_PATH}")
endif()
if (("QT_CMAKE_PREFIX_PATH" STREQUAL "") OR (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}"))
calculate_default_qt_dir(QT_DIR)
set(QT_CMAKE_PREFIX_PATH "${QT_DIR}/lib/cmake")
else()
# figure out where the qt dir is
get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE)
if (NOT DEFINED ENV{QT_CMAKE_PREFIX_PATH} )
set(QT_CMAKE_PREFIX_PATH $ENV{HIFI_VCPKG_BASE_VERSION} "/installed/qt5-install/lib/cmake")
endif()
# figure out where the qt dir is
get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE)
if (WIN32)
# windows shell does not like backslashes expanded on the command line,
# so convert all backslashes in the QT path to forward slashes
@ -56,11 +24,6 @@ macro(setup_qt)
string(REPLACE \\ / QT_DIR ${QT_DIR})
endif()
# This check doesn't work on Mac
#if (NOT EXISTS "${QT_DIR}/include/QtCore/QtGlobal")
# message(FATAL_ERROR "Unable to locate Qt includes in ${QT_DIR}")
#endif()
if (NOT EXISTS "${QT_CMAKE_PREFIX_PATH}/Qt5Core/Qt5CoreConfig.cmake")
message(FATAL_ERROR "Unable to locate Qt cmake config in ${QT_CMAKE_PREFIX_PATH}")
endif()
@ -77,4 +40,4 @@ macro(setup_qt)
add_paths_to_fixup_libs("${QT_DIR}/bin")
endif ()
endmacro()
endmacro()

View file

@ -238,15 +238,17 @@ endif()
def installQt(self):
print("install Qt")
if not os.path.isdir(os.path.join(self.path, 'installed', 'hifi-qt5')):
if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')):
print ("Downloading Qt from AWS")
dest = os.path.join(self.path, 'installed')
if platform.system() == 'Windows':
# url = "https://hifi-qa.s3.amazonaws.com/qt5/Windows/qt5-install.zip"
url = "https://hifi-qa.s3.amazonaws.com/qt5/Windows/hifi-qt5.tar.gz"
url = "https://hifi-qa.s3.amazonaws.com/qt5/Windows/qt5-install.tar.gz"
elif platform.system() == 'Darwin':
url = "https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.zip"
elif platform.system() == 'Linux':
url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.zip"
hifi_utils.downloadAndExtract(url, dest)
else:
print ("Qt has already been downloaded")