From 71bf3f2e14adc3268fb47b1d837837e3e0925ccd Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 21 Apr 2019 20:18:59 -0700 Subject: [PATCH 01/81] Installation folder can be made. --- BUILD_WIN.md | 2 +- hifi_vcpkg.py | 11 ++ tools/qt-builder/README.md | 154 ++++++++++++++++++++++++ tools/qt-builder/patches/aec.patch | 40 ++++++ tools/qt-builder/patches/qfloat16.patch | 44 +++++++ tools/qt-builder/qt5vars.bat | 17 +++ 6 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 tools/qt-builder/README.md create mode 100644 tools/qt-builder/patches/aec.patch create mode 100644 tools/qt-builder/patches/qfloat16.patch create mode 100644 tools/qt-builder/qt5vars.bat diff --git a/BUILD_WIN.md b/BUILD_WIN.md index a81fca5900..a8726b0a23 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -81,7 +81,7 @@ Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. #### CMake can't find OpenSSL -Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. Verify that your VCPKG_ROOT environment variable is set and pointing to the correct location. Verify that the file `${VCPKG_ROOT}/installed/x64-windows/include/openssl/ssl.h` exists. +Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. Verify that your HIFI_VCPKG_BASE environment variable is set and pointing to the correct location. Verify that the file `${HIFI_VCPKG_BASE}/installed/x64-windows/include/openssl/ssl.h` exists. #### Qt is throwing an error diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 4a8004f3a3..a750129360 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -171,6 +171,11 @@ endif() if not self.args.android: print("Installing build dependencies") self.run(['install', '--triplet', self.triplet, 'hifi-client-deps']) + + # If not android, install our Qt build + if not self.args.android: + print("Installing Qt") + self.installQt() def cleanBuilds(self): # Remove temporary build artifacts @@ -232,3 +237,9 @@ endif() print("Not implemented") + def installQt(self): + print("install Qt") + if not os.path.isdir(os.path.join(self.path, 'installed', 'hifi-qt5')): + dest = os.path.join(self.path, 'installed') + url = "https://hifi-qa.s3.amazonaws.com/hifi-qt5.tar.gz" + hifi_utils.downloadAndExtract(url, dest) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md new file mode 100644 index 0000000000..954dc6027b --- /dev/null +++ b/tools/qt-builder/README.md @@ -0,0 +1,154 @@ +# General +This document describes the process to build Qt 5.12.3 +## Requirements +### Windows +1. Visual Studio 2017 + If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). +Install with defaults + +1. python 2.7.16 +Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi +Add path to python executable to PATH. +Verify that python runs python 2.7 (run “python --version”) + +NOTE: our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. + +1. git >= 1.6 +Verify by entering `git --version` +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +Verify by running `perl --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` +Verify by running `bison --version` +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Install +Add C:\Program Files (x86)\GnuWin32\bin to PATH +Verify by running `gperf --version` +### Linux +Tested on Ubuntu 18.04 +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +`sudo apt-get build-dep qt5-default` +1. git >= 1.6 +Verify if needed entering `git --version` +`sudo apt-get install -y git` +Verify again +1. python +Verify if needed running `python --version` - should return python 2.7.x +`sudo apt-get install -y python` (not python 3!) +Verify again +1. gperf +Verify if needed running gperf --version +`sudo apt-get install -y gperf` +Verify again +1. bison and flex +Verify if needed running `flex --version` +Verify if needed running `bison --version` +`sudo apt-get install -y flex bison` +Verify again +1. pkg-config (needed for qtwebengine) +Verify if needed running `pkg-config --version` +`sudo apt-get install -y pkg-config` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install -y mesa-utils`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install -y libgl1-mesa-dev` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Verify by running `make --version` +`sudo apt-get install -y make` +1. g++ +Verify by running `g++ --version` +`sudo apt-get install -y g++` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install -y libdbus-glib-1-dev` +1. nss (needed for qtwebengine) +`sudo apt-get install -y libnss3-dev` +### Mac +1. git >= 1.6 +Verify by entering git --version +1. pkg-config +brew fontconfig dbus-glib stall pkg-config +1. dbus-1 +brew install dbus-glib +## Build Process +### General +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. +Before running configure, make sure that the qt5-build folder is empty. + +**Only run the patches once!!!** +### Windows +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. + +git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch + +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt +cd qt5 +git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch +git apply --ignore-space-change --ignore-whitespace patches/aec.patch + +cd .. +mkdir qt5-install +mkdir qt5-build +cd qt5-build + +run ..\qt5\qt5vars.bat +cd ..\..\qt5-build + +..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install + +nmake +nmake install +### Linux +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch + +* Copy the **patches** folder to qt5 +* Apply the two patches to Qt +cd qt5 +git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch +git apply --ignore-space-change --ignore-whitespace patches/aec.patch +cd .. + +mkdir qt5-install +mkdir qt5-build +cd qt5-build + +../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install + +make +make install +### Mac +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch + +* Copy the **patches** folder to qt5 +* Apply the two patches to Qt +cd qt5 +git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch +git apply --ignore-space-change --ignore-whitespace patches/aec.patch +cd .. + +mkdir qt5-install +mkdir qt5-build +cd ../qt5-build + +../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install + +make +make install +## Problems +*configure* errors, if any, may be viewed in **config.log** and **config.summary** diff --git a/tools/qt-builder/patches/aec.patch b/tools/qt-builder/patches/aec.patch new file mode 100644 index 0000000000..be159d857a --- /dev/null +++ b/tools/qt-builder/patches/aec.patch @@ -0,0 +1,40 @@ +diff --git a/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.cpp b/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.cpp +index ad87cb0..54ed18a 100644 +--- a/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.cpp ++++ b/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.cpp +@@ -117,6 +117,8 @@ QOpenSLESAudioInput::QOpenSLESAudioInput(const QByteArray &device) + m_recorderPreset = SL_ANDROID_RECORDING_PRESET_CAMCORDER; + else if (qstrcmp(device, QT_ANDROID_PRESET_VOICE_RECOGNITION) == 0) + m_recorderPreset = SL_ANDROID_RECORDING_PRESET_VOICE_RECOGNITION; ++ else if (qstrcmp(device, QT_ANDROID_PRESET_VOICE_COMMUNICATION) == 0) ++ m_recorderPreset = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION; + else + m_recorderPreset = SL_ANDROID_RECORDING_PRESET_GENERIC; + #endif +diff --git a/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.h b/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.h +index ad84db0..35cc379 100644 +--- a/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.h ++++ b/qtmultimedia/src/plugins/opensles/qopenslesaudioinput.h +@@ -50,6 +50,7 @@ + #define QT_ANDROID_PRESET_MIC "mic" + #define QT_ANDROID_PRESET_CAMCORDER "camcorder" + #define QT_ANDROID_PRESET_VOICE_RECOGNITION "voicerecognition" ++#define QT_ANDROID_PRESET_VOICE_COMMUNICATION "voicecommunication" + + #endif + +diff --git a/qtmultimedia/src/plugins/opensles/qopenslesengine.cpp b/qtmultimedia/src/plugins/opensles/qopenslesengine.cpp +index 1a16cc2..2577fb3 100644 +--- a/qtmultimedia/src/plugins/opensles/qopenslesengine.cpp ++++ b/qtmultimedia/src/plugins/opensles/qopenslesengine.cpp +@@ -114,7 +114,8 @@ QList QOpenSLESEngine::availableDevices(QAudio::Mode mode) const + #ifdef ANDROID + devices << QT_ANDROID_PRESET_MIC + << QT_ANDROID_PRESET_CAMCORDER +- << QT_ANDROID_PRESET_VOICE_RECOGNITION; ++ << QT_ANDROID_PRESET_VOICE_RECOGNITION ++ << QT_ANDROID_PRESET_VOICE_COMMUNICATION; + #else + devices << "default"; + #endif + \ No newline at end of file diff --git a/tools/qt-builder/patches/qfloat16.patch b/tools/qt-builder/patches/qfloat16.patch new file mode 100644 index 0000000000..2773573264 --- /dev/null +++ b/tools/qt-builder/patches/qfloat16.patch @@ -0,0 +1,44 @@ +diff --git a/qtbase/src/corelib/global/qfloat16.h b/qtbase/src/corelib/global/qfloat16.h +index 3e50ad8467..2453ff8847 100644 +--- a/qtbase/src/corelib/global/qfloat16.h ++++ b/qtbase/src/corelib/global/qfloat16.h +@@ -83,7 +83,9 @@ private: + Q_CORE_EXPORT static const quint32 shifttable[]; + + friend bool qIsNull(qfloat16 f) Q_DECL_NOTHROW; ++#if ! defined(QT_NO_FLOAT16_OPERATORS) + friend qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW; ++#endif + }; + + Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE); +@@ -165,6 +167,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW + } + #endif + ++#if ! defined(QT_NO_FLOAT16_OPERATORS) + inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW + { + qfloat16 f; +@@ -206,11 +209,12 @@ QF16_MAKE_ARITH_OP_INT(-) + QF16_MAKE_ARITH_OP_INT(*) + QF16_MAKE_ARITH_OP_INT(/) + #undef QF16_MAKE_ARITH_OP_INT +- ++#endif + QT_WARNING_PUSH + QT_WARNING_DISABLE_CLANG("-Wfloat-equal") + QT_WARNING_DISABLE_GCC("-Wfloat-equal") + ++#if ! defined(QT_NO_FLOAT16_OPERATORS) + inline bool operator>(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast(a) > static_cast(b); } + inline bool operator<(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast(a) < static_cast(b); } + inline bool operator>=(qfloat16 a, qfloat16 b) Q_DECL_NOTHROW { return static_cast(a) >= static_cast(b); } +@@ -244,6 +248,7 @@ QF16_MAKE_BOOL_OP_INT(<=) + QF16_MAKE_BOOL_OP_INT(==) + QF16_MAKE_BOOL_OP_INT(!=) + #undef QF16_MAKE_BOOL_OP_INT ++#endif + + QT_WARNING_POP + diff --git a/tools/qt-builder/qt5vars.bat b/tools/qt-builder/qt5vars.bat new file mode 100644 index 0000000000..10ad5be4ae --- /dev/null +++ b/tools/qt-builder/qt5vars.bat @@ -0,0 +1,17 @@ +@echo off + +REM Set up \Microsoft Visual Studio 2015, where is \c amd64, \c x86, etc. +CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 + +REM Edit this location to point to the source code of Qt +SET _ROOT=..\qt5 + +SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% + +REM Uncomment the below line when using a git checkout of the source repository +SET PATH=%_ROOT%\qtrepotools\bin;%PATH% + +SET _ROOT= + +REM Keeps the command line open when this script is run. +cmd /k \ No newline at end of file From 0da6e088cbf1298bf3db6168065ae6c5718578d1 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 13:15:10 -0700 Subject: [PATCH 02/81] Updated readme. --- tools/qt-builder/README.md | 58 +++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 26 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 954dc6027b..c3cb8b5180 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -1,5 +1,7 @@ # General -This document describes the process to build Qt 5.12.3 +This document describes the process to build Qt 5.12.3. +Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. +The second patch is to OpenSL ES audio. ## Requirements ### Windows 1. Visual Studio 2017 @@ -7,13 +9,16 @@ This document describes the process to build Qt 5.12.3 Install with defaults 1. python 2.7.16 +Check if needed running `python --version` - should return python 2.7.x Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi Add path to python executable to PATH. -Verify that python runs python 2.7 (run “python --version”) -NOTE: our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. +NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. +Verify that python runs python 2.7 (run “python --version”) 1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win Verify by entering `git --version` 1. perl >= 5.14 Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ @@ -37,47 +42,50 @@ edit /etc/apt/sources.list (edit as root) replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) `sudo apt-get update -y` `sudo apt-get upgrade -y` -`sudo apt-get build-dep qt5-default` +`sudo apt-get build-dep qt5-default -y` 1. git >= 1.6 -Verify if needed entering `git --version` -`sudo apt-get install -y git` +Check if needed `git --version` +`sudo apt-get install git -y` Verify again 1. python -Verify if needed running `python --version` - should return python 2.7.x -`sudo apt-get install -y python` (not python 3!) +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) Verify again 1. gperf -Verify if needed running gperf --version -`sudo apt-get install -y gperf` +Check if needed `gperf --version` +`sudo apt-get install gperf -y` Verify again 1. bison and flex -Verify if needed running `flex --version` -Verify if needed running `bison --version` -`sudo apt-get install -y flex bison` +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` Verify again 1. pkg-config (needed for qtwebengine) -Verify if needed running `pkg-config --version` -`sudo apt-get install -y pkg-config` +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` Verify again 1. OpenGL -Verify (first install mesa-utils - `sudo apt install -y mesa-utils`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install -y libgl1-mesa-dev` +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` `sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` Verify again 1. make -Verify by running `make --version` -`sudo apt-get install -y make` +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again 1. g++ -Verify by running `g++ --version` -`sudo apt-get install -y g++` +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` Verify again 1. dbus-1 (needed for qtwebengine) -`sudo apt-get install -y libdbus-glib-1-dev` +`sudo apt-get install libdbus-glib-1-dev -y` 1. nss (needed for qtwebengine) -`sudo apt-get install -y libnss3-dev` +`sudo apt-get install libnss3-dev -y` ### Mac 1. git >= 1.6 -Verify by entering git --version +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again 1. pkg-config brew fontconfig dbus-glib stall pkg-config 1. dbus-1 @@ -120,7 +128,6 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch * Copy the **patches** folder to qt5 * Apply the two patches to Qt cd qt5 -git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch git apply --ignore-space-change --ignore-whitespace patches/aec.patch cd .. @@ -138,7 +145,6 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch * Copy the **patches** folder to qt5 * Apply the two patches to Qt cd qt5 -git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch git apply --ignore-space-change --ignore-whitespace patches/aec.patch cd .. From bfcdec62a28ae8e5d01158bb224f89239bd3aac6 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 15:00:22 -0700 Subject: [PATCH 03/81] Before testing. --- hifi_vcpkg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index a750129360..1fbbaa4028 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -241,5 +241,12 @@ endif() print("install Qt") if not os.path.isdir(os.path.join(self.path, 'installed', 'hifi-qt5')): dest = os.path.join(self.path, 'installed') - url = "https://hifi-qa.s3.amazonaws.com/hifi-qt5.tar.gz" + 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" + 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) From 4b26ef7c0f0dff4fee40168fdbdfc4ebea056ac4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 16:19:40 -0700 Subject: [PATCH 04/81] Updated with upload to AWS instructions. --- tools/qt-builder/README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index c3cb8b5180..79516def85 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -122,6 +122,10 @@ cd ..\..\qt5-build nmake nmake install + +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from qt5-install.tar folder (e.g. using 7-zip) +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch @@ -139,6 +143,9 @@ cd qt5-build make make install + +tar -zcvf qt5-install.tar.gz qt5-install +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch @@ -156,5 +163,8 @@ cd ../qt5-build make make install + +tar -zcvf qt5-install.tar.gz qt5-install +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From 24110ebf8691a488bf7e3bdb070ad18fc2434399 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 17:58:20 -0700 Subject: [PATCH 05/81] Ready for Mac/Linux testing. --- cmake/macros/SetupQt.cmake | 49 +++++--------------------------------- hifi_vcpkg.py | 10 ++++---- 2 files changed, 12 insertions(+), 47 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 71f5314d2f..c287b103c1 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -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() \ No newline at end of file diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 1fbbaa4028..363fbb51d9 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -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") + From d7197dba650b5728098cc4c3425adb10c5ff15dd Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 20:56:32 -0700 Subject: [PATCH 06/81] Use QT_CMAKE_PREFIX_PATH only on local builds. --- cmake/macros/SetupQt.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index c287b103c1..1a59a510f1 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -8,9 +8,12 @@ # 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 DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) + # if we are in a development build and QT_CMAKE_PREFIX_PATH is specified + # then use it, + # otherwise, use the vcpkg'ed version + if ((RELEASE_TYPE STREQUAL "DEV") AND DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) + set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) + else () set(QT_CMAKE_PREFIX_PATH $ENV{HIFI_VCPKG_BASE_VERSION} "/installed/qt5-install/lib/cmake") endif() From dd85e224a46e84564fe0d602aeba2214ebd548c5 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 20:58:15 -0700 Subject: [PATCH 07/81] Activate Qt patch. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 551cfd2636..a6e92ef0a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,6 +196,12 @@ find_package( Threads ) add_definitions(-DGLM_FORCE_RADIANS) add_definitions(-DGLM_ENABLE_EXPERIMENTAL) add_definitions(-DGLM_FORCE_CTOR_INIT) + +if (WIN32) + # Deal with fakakta Visual Studo 2017 bug + add_definitions(-DQT_NO_FLOAT16_OPERATORS) +endif() + if (HIFI_USE_OPTIMIZED_IK) MESSAGE(STATUS "SET THE USE IK DEFINITION ") add_definitions(-DHIFI_USE_OPTIMIZED_IK) From 01a838b5cb129913e89ff55e9c04b23e89bdcac5 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 21:36:35 -0700 Subject: [PATCH 08/81] Updated for Jenkins. --- cmake/macros/SetupQt.cmake | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 1a59a510f1..76b4ec098e 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -11,10 +11,18 @@ macro(setup_qt) # if we are in a development build and QT_CMAKE_PREFIX_PATH is specified # then use it, # otherwise, use the vcpkg'ed version - if ((RELEASE_TYPE STREQUAL "DEV") AND DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) - set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) + if (RELEASE_TYPE STREQUAL "DEV") + if (DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) + set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) + else () + set(QT_CMAKE_PREFIX_PATH $ENV{HIFI_VCPKG_BASE_VERSION} "/installed/qt5-install/lib/cmake") + endif() else () - set(QT_CMAKE_PREFIX_PATH $ENV{HIFI_VCPKG_BASE_VERSION} "/installed/qt5-install/lib/cmake") + if (WIN32) + set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/installed/qt5-install/lib/cmake") + else () + set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") + endif() endif() # figure out where the qt dir is From bffc0e8a85e0b9d86e0b0e4e0e803bc121b30ef6 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 22 Apr 2019 23:28:43 -0700 Subject: [PATCH 09/81] Re-ordered commands. --- CMakeLists.txt | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6e92ef0a5..c8792d87ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,9 +86,9 @@ if (ANDROID) set(PLATFORM_QT_COMPONENTS AndroidExtras WebView) add_definitions(-DHIFI_ANDROID_APP=\"${HIFI_ANDROID_APP}\") if ( - (${HIFI_ANDROID_APP} STREQUAL "questInterface") OR + (${HIFI_ANDROID_APP} STREQUAL "questInterface") OR (${HIFI_ANDROID_APP} STREQUAL "questFramePlayer") OR - (${HIFI_ANDROID_APP} STREQUAL "framePlayer") + (${HIFI_ANDROID_APP} STREQUAL "framePlayer") ) # We know the quest hardware has this extension, so we can force the use of instanced stereo add_definitions(-DHAVE_EXT_clip_cull_distance) @@ -98,18 +98,18 @@ if (ANDROID) # We can also use our own foveated textures add_definitions(-DHAVE_QCOM_texture_foveated) - # if set, the application itself or some library it depends on MUST implement + # if set, the application itself or some library it depends on MUST implement # `DisplayPluginList getDisplayPlugins()` and `InputPluginList getInputPlugins()` - add_definitions(-DCUSTOM_INPUT_PLUGINS) - add_definitions(-DCUSTOM_DISPLAY_PLUGINS) + add_definitions(-DCUSTOM_INPUT_PLUGINS) + add_definitions(-DCUSTOM_DISPLAY_PLUGINS) set(PLATFORM_PLUGIN_LIBRARIES oculusMobile oculusMobilePlugin) endif() # Allow client code to use preprocessor macros to distinguish between quest and non-quest builds if (${HIFI_ANDROID_APP} STREQUAL "questInterface") - add_definitions(-DANDROID_APP_QUEST_INTERFACE) + add_definitions(-DANDROID_APP_QUEST_INTERFACE) elseif(${HIFI_ANDROID_APP} STREQUAL "interface") - add_definitions(-DANDROID_APP_INTERFACE) + add_definitions(-DANDROID_APP_INTERFACE) endif() else () set(PLATFORM_QT_COMPONENTS WebEngine Xml) @@ -187,6 +187,8 @@ GroupSources("scripts") GroupSources("unpublishedScripts") unset(JS_SRC) +set_packaging_parameters() + # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}") @@ -214,8 +216,6 @@ setup_externals_binary_dir() option(USE_NSIGHT "Attempt to find the nSight libraries" 1) -set_packaging_parameters() - # FIXME hack to work on the proper Android toolchain if (ANDROID) add_subdirectory(android/apps/${HIFI_ANDROID_APP}) @@ -249,11 +249,11 @@ add_subdirectory(tools) if (BUILD_TESTS) # Turn on testing so that add_test works - # MUST be in the root cmake file for ctest to work + # MUST be in the root cmake file for ctest to work include(CTest) enable_testing() add_subdirectory(tests) - if (BUILD_MANUAL_TESTS) + if (BUILD_MANUAL_TESTS) add_subdirectory(tests-manual) endif() endif() From 5144c3b0a8b9b5f180b54e97668d4ff6f80bed02 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 07:22:29 -0700 Subject: [PATCH 10/81] testing --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 363fbb51d9..dc3558db82 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -238,7 +238,7 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if True or 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': From 55e184135858854b7ccca0acdde4e73301cd4f24 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 07:58:33 -0700 Subject: [PATCH 11/81] testing --- cmake/macros/SetupQt.cmake | 4 +++- hifi_vcpkg.py | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 76b4ec098e..b3db49166a 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -34,7 +34,9 @@ macro(setup_qt) string(REPLACE \\ / QT_CMAKE_PREFIX_PATH ${QT_CMAKE_PREFIX_PATH}) string(REPLACE \\ / QT_DIR ${QT_DIR}) endif() - +message("==================") +message(STATUS ${QT_CMAKE_PREFIX_PATH}) +message("==================") 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() diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index dc3558db82..1cd33ed54d 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -248,6 +248,10 @@ endif() elif platform.system() == 'Linux': url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.zip" + print("+++++++++++++++++++++++") + print(dest) + print(url) + print("+++++++++++++++++++++++") hifi_utils.downloadAndExtract(url, dest) else: print ("Qt has already been downloaded") From 182799b4ec4c858385ed24bd88cd8591cd836648 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 08:07:25 -0700 Subject: [PATCH 12/81] testing --- cmake/macros/SetupQt.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index b3db49166a..7697ce0477 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -24,6 +24,7 @@ macro(setup_qt) set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") endif() endif() +set(QT_CMAKE_PREFIX_PATH "C:\Windows\TEMP\hifi\vcpkg\cb433fd7\installed/lib/cmake") # figure out where the qt dir is get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) From e7b780fcb9c0e4f052299d7bbf3a17b610b34217 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 08:11:09 -0700 Subject: [PATCH 13/81] testing --- cmake/macros/SetupQt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 7697ce0477..be0fa23fb2 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -24,7 +24,7 @@ macro(setup_qt) set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") endif() endif() -set(QT_CMAKE_PREFIX_PATH "C:\Windows\TEMP\hifi\vcpkg\cb433fd7\installed/lib/cmake") +set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/cb433fd7/installed/lib/cmake") # figure out where the qt dir is get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) From 2963dd8fa57291d03b4c1e6e0e3dafedab90ec21 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 08:18:41 -0700 Subject: [PATCH 14/81] testing --- cmake/macros/SetupQt.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index be0fa23fb2..c40a177a44 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -24,7 +24,7 @@ macro(setup_qt) set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") endif() endif() -set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/cb433fd7/installed/lib/cmake") +set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/cb433fd7/installed/qt5-install/lib/cmake") # figure out where the qt dir is get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) From 0179ba8e67a145d30a10ec6c492433c444bff03c Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 09:12:47 -0700 Subject: [PATCH 15/81] testing - removed oven. --- tools/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index fd74786a5e..cd77516259 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -31,7 +31,7 @@ if (BUILD_TOOLS) ac-client skeleton-dump atp-client - oven + # oven ) else() set(ALL_TOOLS @@ -44,7 +44,7 @@ if (BUILD_TOOLS) ac-client skeleton-dump atp-client - oven + # oven nitpick ) endif() From c9d128ae71ac6d899e16f7aafa440c3a4ff24b9f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 10:39:52 -0700 Subject: [PATCH 16/81] testing --- cmake/macros/SetupQt.cmake | 19 +++++++------------ hifi_vcpkg.py | 11 +++++------ tools/CMakeLists.txt | 4 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index c40a177a44..d6f47e20da 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -14,17 +14,14 @@ macro(setup_qt) if (RELEASE_TYPE STREQUAL "DEV") if (DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) - else () - set(QT_CMAKE_PREFIX_PATH $ENV{HIFI_VCPKG_BASE_VERSION} "/installed/qt5-install/lib/cmake") - endif() - else () - if (WIN32) - set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/installed/qt5-install/lib/cmake") - else () - set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") endif() +### else () +### if (WIN32) +### set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/installed/qt5-install/lib/cmake") +### else () +### set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") +### endif() endif() -set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/cb433fd7/installed/qt5-install/lib/cmake") # figure out where the qt dir is get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) @@ -35,9 +32,7 @@ set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/cb433fd7/installed/qt5-inst string(REPLACE \\ / QT_CMAKE_PREFIX_PATH ${QT_CMAKE_PREFIX_PATH}) string(REPLACE \\ / QT_DIR ${QT_DIR}) endif() -message("==================") -message(STATUS ${QT_CMAKE_PREFIX_PATH}) -message("==================") + 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() diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 1cd33ed54d..1c621543b5 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -19,6 +19,7 @@ get_filename_component(CMAKE_TOOLCHAIN_FILE "{}" ABSOLUTE CACHE) get_filename_component(CMAKE_TOOLCHAIN_FILE_UNCACHED "{}" ABSOLUTE) set(VCPKG_INSTALL_ROOT "{}") set(VCPKG_TOOLS_DIR "{}") +set(QT_CMAKE_PREFIX_PATH "{}") """ CMAKE_TEMPLATE_NON_ANDROID = """ @@ -217,6 +218,7 @@ endif() cmakeScript = os.path.join(self.path, 'scripts/buildsystems/vcpkg.cmake') installPath = os.path.join(self.path, 'installed', self.triplet) toolsPath = os.path.join(self.path, 'installed', self.hostTriplet, 'tools') + cmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE if not self.args.android: cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID @@ -226,7 +228,7 @@ endif() cmakeTemplate += 'set(HIFI_ANDROID_PRECOMPILED "{}")\n'.format(precompiled) cmakeTemplate += 'set(QT_CMAKE_PREFIX_PATH "{}")\n'.format(qtCmakePrefix) - cmakeConfig = cmakeTemplate.format(cmakeScript, cmakeScript, installPath, toolsPath).replace('\\', '/') + cmakeConfig = cmakeTemplate.format(cmakeScript, cmakeScript, installPath, toolsPath, cmakePrefixPath).replace('\\', '/') with open(self.configFilePath, 'w') as f: f.write(cmakeConfig) @@ -238,7 +240,8 @@ endif() def installQt(self): - if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + #if True or 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': @@ -248,10 +251,6 @@ endif() elif platform.system() == 'Linux': url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.zip" - print("+++++++++++++++++++++++") - print(dest) - print(url) - print("+++++++++++++++++++++++") hifi_utils.downloadAndExtract(url, dest) else: print ("Qt has already been downloaded") diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index cd77516259..fd74786a5e 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -31,7 +31,7 @@ if (BUILD_TOOLS) ac-client skeleton-dump atp-client - # oven + oven ) else() set(ALL_TOOLS @@ -44,7 +44,7 @@ if (BUILD_TOOLS) ac-client skeleton-dump atp-client - # oven + oven nitpick ) endif() From 2edf1676eafe9013b04a6efcd78a9a97386f9108 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 10:45:33 -0700 Subject: [PATCH 17/81] Corrected filenames for Mac and Ubuntu. --- hifi_vcpkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 1c621543b5..d74d008a96 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -247,9 +247,9 @@ endif() if platform.system() == 'Windows': 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" + url = "https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.tar.gz" elif platform.system() == 'Linux': - url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.zip" + url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.tar.gz" hifi_utils.downloadAndExtract(url, dest) else: From ffa0902dfc83534596e1deab653168c304ecfa85 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 13:04:16 -0700 Subject: [PATCH 18/81] testing. --- hifi_vcpkg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index d74d008a96..854033e95f 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,8 +240,8 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): - #if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + ### if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if True or 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': From d3e3fa5249fb78172c0db9455f3a97e5cb7765e0 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 13:20:13 -0700 Subject: [PATCH 19/81] Added debug message. --- hifi_vcpkg.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 854033e95f..89bb5734b7 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -242,7 +242,7 @@ endif() def installQt(self): ### if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): - print ("Downloading Qt from AWS") + 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.tar.gz" @@ -250,7 +250,8 @@ endif() url = "https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.tar.gz" elif platform.system() == 'Linux': url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.tar.gz" - + + print("Extracting " + url + " to " + dest) hifi_utils.downloadAndExtract(url, dest) else: print ("Qt has already been downloaded") From 9b8f07989930189d5823d43a5bf59c1a6da4479f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 13:37:47 -0700 Subject: [PATCH 20/81] Testing. --- hifi_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_utils.py b/hifi_utils.py index 24e43dc83c..d117011c99 100644 --- a/hifi_utils.py +++ b/hifi_utils.py @@ -118,6 +118,6 @@ def downloadAndExtract(url, destPath, hash=None, hasher=hashlib.sha512(), isZip= zip.extractall(destPath) else: # Extract the archive - with tarfile.open(tempFileName, 'r:gz') as tgz: + with tarfile.open(tempFileName, 'r:*') as tgz: tgz.extractall(destPath) os.remove(tempFileName) From 68f9b473a6a84270a914c2742178a67f697e728f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 15:06:17 -0700 Subject: [PATCH 21/81] Updated python interface. --- tools/nitpick/src/PythonInterface.cpp | 14 +++++++++----- tools/nitpick/src/PythonInterface.h | 4 ++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/nitpick/src/PythonInterface.cpp b/tools/nitpick/src/PythonInterface.cpp index dcf4ecc682..48ca3b30e0 100644 --- a/tools/nitpick/src/PythonInterface.cpp +++ b/tools/nitpick/src/PythonInterface.cpp @@ -16,12 +16,16 @@ QString PythonInterface::getPythonCommand() { #ifdef Q_OS_WIN if (_pythonCommand.isNull()) { - QString pythonPath = PathUtils::getPathToExecutable("python.exe"); + // Use the python launcher as we need python 3, and python 2 may be installed + // See https://www.python.org/dev/peps/pep-0397/ + const QString pythonLauncherExecutable{ "py.exe" }; + QString pythonPath = PathUtils::getPathToExecutable(pythonLauncherExecutable); if (!pythonPath.isNull()) { _pythonCommand = pythonPath + _pythonExe; - } else { - QMessageBox::critical(0, "python.exe not found", - "Please verify that pyton.exe is in the PATH"); + } + else { + QMessageBox::critical(0, pythonLauncherExecutable + " not found", + "Please verify that py.exe is in the PATH"); exit(-1); } } @@ -35,4 +39,4 @@ QString PythonInterface::getPythonCommand() { #endif return _pythonCommand; -} +} \ No newline at end of file diff --git a/tools/nitpick/src/PythonInterface.h b/tools/nitpick/src/PythonInterface.h index 7972d55cce..d51b51d007 100644 --- a/tools/nitpick/src/PythonInterface.h +++ b/tools/nitpick/src/PythonInterface.h @@ -18,7 +18,7 @@ public: private: #ifdef Q_OS_WIN - const QString _pythonExe{ "python.exe" }; + const QString _pythonExe{ "py.exe" }; #else // Both Mac and Linux use "python" const QString _pythonExe{ "python" }; @@ -27,4 +27,4 @@ private: QString _pythonCommand; }; -#endif // hifi_PythonInterface_h +#endif // hifi_PythonInterface_h \ No newline at end of file From f4b1aedbaeb29fc364492f20b9ed0557b92256bc Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 15:06:40 -0700 Subject: [PATCH 22/81] Minor cleanup. --- cmake/macros/SetupQt.cmake | 12 ++---------- hifi_vcpkg.py | 3 +-- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index d6f47e20da..fafed63e88 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -11,16 +11,8 @@ macro(setup_qt) # if we are in a development build and QT_CMAKE_PREFIX_PATH is specified # then use it, # otherwise, use the vcpkg'ed version - if (RELEASE_TYPE STREQUAL "DEV") - if (DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) - set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) - endif() -### else () -### if (WIN32) -### set(QT_CMAKE_PREFIX_PATH "C:/Windows/TEMP/hifi/vcpkg/installed/qt5-install/lib/cmake") -### else () -### set(QT_CMAKE_PREFIX_PATH "/tmp/hifi/vcpkg/installed/qt5-install/lib/cmake") -### endif() + if (RELEASE_TYPE STREQUAL "DEV" AND DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) + set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) endif() # figure out where the qt dir is diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 89bb5734b7..e1d509b9df 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,8 +240,7 @@ endif() def installQt(self): - ### if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): - if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + 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': From e755e717b15d4e3e7aace2de350121d008b2feff Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 15:59:03 -0700 Subject: [PATCH 23/81] Restored code. --- hifi_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_utils.py b/hifi_utils.py index d117011c99..24e43dc83c 100644 --- a/hifi_utils.py +++ b/hifi_utils.py @@ -118,6 +118,6 @@ def downloadAndExtract(url, destPath, hash=None, hasher=hashlib.sha512(), isZip= zip.extractall(destPath) else: # Extract the archive - with tarfile.open(tempFileName, 'r:*') as tgz: + with tarfile.open(tempFileName, 'r:gz') as tgz: tgz.extractall(destPath) os.remove(tempFileName) From 70531bca5242cb0b7131e189b243e8594047d038 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 16:51:27 -0700 Subject: [PATCH 24/81] Updated with new Ubuntu zip instructions. --- tools/qt-builder/README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 79516def85..5a2df21685 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -122,7 +122,7 @@ cd ..\..\qt5-build nmake nmake install - +#### Uploading Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) Create a gzip file called qt5-install.tar.gz from qt5-install.tar folder (e.g. using 7-zip) Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ @@ -142,10 +142,22 @@ cd qt5-build ../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install make -make install +make install +#### Uploading +1. Return to the home folder +`cd ..` + +1. Open a python 3 shell +`python3` -tar -zcvf qt5-install.tar.gz qt5-install -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz"))` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` + +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch @@ -163,7 +175,7 @@ cd ../qt5-build make make install - +#### Uploading tar -zcvf qt5-install.tar.gz qt5-install Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems From a0068cabb76e290f9673aa898a76a07d3399244f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 17:04:33 -0700 Subject: [PATCH 25/81] Force download of Qt. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index e1d509b9df..7bc35b28c3 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if True or 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': From 960443323f21e268025587b5ac45af48bcc6e969 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 18:47:43 -0700 Subject: [PATCH 26/81] Cleaned up readme --- tools/qt-builder/README.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 5a2df21685..c6dfa3ce78 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -44,43 +44,43 @@ replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) `sudo apt-get upgrade -y` `sudo apt-get build-dep qt5-default -y` 1. git >= 1.6 -Check if needed `git --version` +Check if needed `git --version` `sudo apt-get install git -y` -Verify again +Verify again 1. python -Check if needed `python --version` - should return python 2.7.x +Check if needed `python --version` - should return python 2.7.x `sudo apt-get install python -y` (not python 3!) -Verify again +Verify again 1. gperf -Check if needed `gperf --version` +Check if needed `gperf --version` `sudo apt-get install gperf -y` -Verify again +Verify again 1. bison and flex Check if needed `flex --version` and `bison --version` `sudo apt-get install flex bison -y` -Verify again +Verify again 1. pkg-config (needed for qtwebengine) Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again +`sudo apt-get install pkg-config -y` +Verify again 1. OpenGL Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` `sudo apt-get install libgl1-mesa-dev -y` `sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again +Verify again 1. make -Check if needed `make --version` +Check if needed `make --version` `sudo apt-get install make -y` Verify again 1. g++ Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again + `g++ --version` +`sudo apt-get install g++ -y` +Verify again 1. dbus-1 (needed for qtwebengine) `sudo apt-get install libdbus-glib-1-dev -y` 1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` +`sudo apt-get install libnss3-dev -y` ### Mac 1. git >= 1.6 Check if needed `git --version` From 4b7a3ac332dec4aa5c66c49a2e502c5e1ab06011 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 23 Apr 2019 19:00:30 -0700 Subject: [PATCH 27/81] Cleaned up readme --- tools/qt-builder/README.md | 68 +++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index c6dfa3ce78..bbeb1b257c 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -101,48 +101,48 @@ Before running configure, make sure that the qt5-build folder is empty. ### Windows Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. -git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` * Copy the **patches** folder to qt5 * Copy the **qt5vars.bat** file to qt5 * Apply the two patches to Qt -cd qt5 -git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch -git apply --ignore-space-change --ignore-whitespace patches/aec.patch +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -cd .. -mkdir qt5-install -mkdir qt5-build -cd qt5-build +`cd ..` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -run ..\qt5\qt5vars.bat -cd ..\..\qt5-build +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install +`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` -nmake -nmake install +`nmake` +`nmake install` #### Uploading Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) Create a gzip file called qt5-install.tar.gz from qt5-install.tar folder (e.g. using 7-zip) Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` * Copy the **patches** folder to qt5 -* Apply the two patches to Qt -cd qt5 -git apply --ignore-space-change --ignore-whitespace patches/aec.patch -cd .. +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` -mkdir qt5-install -mkdir qt5-build -cd qt5-build +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` -make -make install +`make` +`make install` #### Uploading 1. Return to the home folder `cd ..` @@ -163,20 +163,20 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch * Copy the **patches** folder to qt5 * Apply the two patches to Qt -cd qt5 -git apply --ignore-space-change --ignore-whitespace patches/aec.patch -cd .. +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` -mkdir qt5-install -mkdir qt5-build -cd ../qt5-build +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` -../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install +`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` -make -make install +`make` +`make install` #### Uploading -tar -zcvf qt5-install.tar.gz qt5-install +`tar -zcvf qt5-install.tar.gz qt5-install` Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From 030f17299992b90aab462f09d3183a194dc09a78 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 10:28:11 -0700 Subject: [PATCH 28/81] Updated readme for "Fix" --- tools/qt-builder/README.md | 43 ++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index bbeb1b257c..5a46ce7202 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -32,9 +32,23 @@ Verify by running `flex --version` Verify by running `bison --version` 1. gperf Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Install Add C:\Program Files (x86)\GnuWin32\bin to PATH Verify by running `gperf --version` +1. 7-zip +Download from https://www.7-zip.org/download.html +1. Bash shell +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* +Click *Restart now* +Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version +[First run will take a few minutes] +Enter a user name - all small letters (this is not required for later use) +Choose a password ### Linux Tested on Ubuntu 18.04 1. qt5 requirements @@ -100,7 +114,7 @@ Before running configure, make sure that the qt5-build folder is empty. **Only run the patches once!!!** ### Windows Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. - +#### Preparing source files `git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` * Copy the **patches** folder to qt5 @@ -109,8 +123,8 @@ Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* fol `cd qt5` `git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` `git apply --ignore-space-change --ignore-whitespace patches/aec.patch` - `cd ..` +#### Configuring `mkdir qt5-install` `mkdir qt5-build` `cd qt5-build` @@ -119,14 +133,21 @@ run `..\qt5\qt5vars.bat` `cd ..\..\qt5-build` `..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` - +#### Make `nmake` `nmake install` +#### Fixing +The *.prl* files have an absolute path that needs to be removed +1. Open a bash terminal +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` #### Uploading Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from qt5-install.tar folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux +#### Preparing source files `git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` * Copy the **patches** folder to qt5 @@ -134,15 +155,17 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `cd qt5` `git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` +#### Configuring `mkdir qt5-install` `mkdir qt5-build` `cd qt5-build` `../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` - +#### Make `make` `make install` +#### Fixing #### Uploading 1. Return to the home folder `cd ..` @@ -159,22 +182,24 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ 1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac +#### Preparing source files git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch * Copy the **patches** folder to qt5 -* Apply the two patches to Qt +* Apply one patch to Qt `cd qt5` `git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` - +#### Configuring `mkdir qt5-install` `mkdir qt5-build` `cd ../qt5-build` `../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` - +#### Make `make` `make install` +#### Fixing #### Uploading `tar -zcvf qt5-install.tar.gz qt5-install` Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ From 2009ce95b2a2524379c2ab719b755b7cdfd9d157 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 11:37:46 -0700 Subject: [PATCH 29/81] Updated readme. --- tools/qt-builder/README.md | 305 +++++++++++++++++++------------------ 1 file changed, 154 insertions(+), 151 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 5a46ce7202..e2ad3db6ea 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -1,207 +1,210 @@ # General -This document describes the process to build Qt 5.12.3. -Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. +This document describes the process to build Qt 5.12.3. +Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. The second patch is to OpenSL ES audio. ## Requirements ### Windows -1. Visual Studio 2017 - If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). +1. Visual Studio 2017 + If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). Install with defaults -1. python 2.7.16 -Check if needed running `python --version` - should return python 2.7.x -Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi -Add path to python executable to PATH. +1. python 2.7.16 +Check if needed running `python --version` - should return python 2.7.x +Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi +Add path to python executable to PATH. NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. -Verify that python runs python 2.7 (run “python --version”) -1. git >= 1.6 -Check if needed `git --version` -Download from https://git-scm.com/download/win +Verify that python runs python 2.7 (run “python --version”) +1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win Verify by entering `git --version` -1. perl >= 5.14 -Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ Verify by running `perl --version` -1. flex and bison -Download from https://sourceforge.net/projects/winflexbison/files/latest/download -Uncompress in C:\flex_bison -Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe -Add C:\flex_bison to PATH -Verify by running `flex --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` Verify by running `bison --version` -1. gperf -Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Add C:\Program Files (x86)\GnuWin32\bin to PATH +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Add C:\Program Files (x86)\GnuWin32\bin to PATH Verify by running `gperf --version` 1. 7-zip -Download from https://www.7-zip.org/download.html +Download from https://www.7-zip.org/download.html 1. Bash shell -From *Settings* select *Update & Security* -Select *For Developers* -Enable *Developer mode* -Restart PC -Open Control Panel and select *Programs and Features* -Select *Turn Windows features on or off* -Check *Windows Subsystem for Linux* +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* Click *Restart now* Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version -[First run will take a few minutes] -Enter a user name - all small letters (this is not required for later use) -Choose a password +[First run will take a few minutes] +Enter a user name - all small letters (this is not required for later use) +Choose a password ### Linux -Tested on Ubuntu 18.04 -1. qt5 requirements -edit /etc/apt/sources.list (edit as root) -replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) -`sudo apt-get update -y` -`sudo apt-get upgrade -y` +Tested on Ubuntu 18.04 +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` `sudo apt-get build-dep qt5-default -y` -1. git >= 1.6 -Check if needed `git --version` -`sudo apt-get install git -y` -Verify again -1. python -Check if needed `python --version` - should return python 2.7.x -`sudo apt-get install python -y` (not python 3!) -Verify again -1. gperf -Check if needed `gperf --version` -`sudo apt-get install gperf -y` -Verify again -1. bison and flex -Check if needed `flex --version` and `bison --version` -`sudo apt-get install flex bison -y` -Verify again -1. pkg-config (needed for qtwebengine) -Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again -1. OpenGL -Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install libgl1-mesa-dev -y` -`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again -1. make -Check if needed `make --version` -`sudo apt-get install make -y` -Verify again -1. g++ -Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again -1. dbus-1 (needed for qtwebengine) -`sudo apt-get install libdbus-glib-1-dev -y` -1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` -### Mac -1. git >= 1.6 -Check if needed `git --version` -Install from https://git-scm.com/download/mac +1. git >= 1.6 +Check if needed `git --version` +`sudo apt-get install git -y` Verify again -1. pkg-config +1. python +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) +Verify again +1. gperf +Check if needed `gperf --version` +`sudo apt-get install gperf -y` +Verify again +1. bison and flex +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` +Verify again +1. pkg-config (needed for qtwebengine) +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again +1. g++ +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install libdbus-glib-1-dev -y` +1. nss (needed for qtwebengine) +`sudo apt-get install libnss3-dev -y` +### Mac +1. git >= 1.6 +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again +1. pkg-config brew fontconfig dbus-glib stall pkg-config -1. dbus-1 +1. dbus-1 brew install dbus-glib ## Build Process ### General -qt is cloned to the qt5 folder. -The build is performed in the qt5-build folder. -Build products are installed to the qt5-install folder. +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. Before running configure, make sure that the qt5-build folder is empty. **Only run the patches once!!!** ### Windows -Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. -#### Preparing source files -`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. +#### Preparing source files +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Copy the **qt5vars.bat** file to qt5 -* Apply the two patches to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -run `..\qt5\qt5vars.bat` -`cd ..\..\qt5-build` +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` +`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make -`nmake` -`nmake install` +`nmake` +`nmake install` #### Fixing -The *.prl* files have an absolute path that needs to be removed +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) 1. Open a bash terminal -1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) -1. Run the following command (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -#### Uploading -Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +#### Uploading +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux -#### Preparing source files -`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +#### Preparing source files +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -#### Uploading -1. Return to the home folder +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +#### Uploading +1. Return to the home folder `cd ..` - -1. Open a python 3 shell -`python3` -1. Run the following snippet: -`import os` -`import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz"))` -`filename.add("qt5-install", os.path.basename("qt5-install"))` -`exit()` - +1. Open a python 3 shell +`python3` + +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` + 1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac -#### Preparing source files +#### Preparing source files git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd ../qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -#### Uploading -`tar -zcvf qt5-install.tar.gz qt5-install` +#### Uploading +`tar -zcvf qt5-install.tar.gz qt5-install` Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From bd40ea057b4ebd3541981fea8217f14e1d273a26 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 14:42:18 -0700 Subject: [PATCH 30/81] Testing `windeployqt` --- cmake/macros/PackageLibrariesForDeployment.cmake | 7 +++++++ hifi_vcpkg.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index 29f4617a6f..fa7f52993b 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -36,6 +36,13 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) endif () # add a post-build command to call windeployqt to copy Qt plugins +message("+++++++++++++++++++++++++++++++++++++") +message(STATUS ${TARGET_NAME}) +message(STATUS ${QT_DIR}) +message(STATUS ${TARGET_FILE}) +message(STATUS ${WINDEPLOYQT_COMMAND}) +message(STATUS ${EXTRA_DEPLOY_OPTIONS}) +message("-------------------------------------") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 7bc35b28c3..e1d509b9df 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + 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': From 331f692e34929d9d9d579da724fb942e4131ede4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 17:39:02 -0700 Subject: [PATCH 31/81] Cleanup of readme. --- tools/qt-builder/README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index e2ad3db6ea..f3aeb7a497 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -134,7 +134,7 @@ run `..\qt5\qt5vars.bat` `..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make -`nmake` +`nmake` `nmake install` #### Fixing The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) @@ -163,7 +163,7 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` +`make` `make install` #### Fixing The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) @@ -176,12 +176,12 @@ The *.prl* files have an absolute path that needs to be removed (see http://www. 1. Open a python 3 shell `python3` -1. Run the following snippet: -`import os` -`import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` -`filename.add("qt5-install", os.path.basename("qt5-install"))` -`exit()` +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` 1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac @@ -200,11 +200,11 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch `../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` +`make` `make install` #### Fixing #### Uploading -`tar -zcvf qt5-install.tar.gz qt5-install` +`tar -zcvf qt5-install.tar.gz qt5-install` Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From ba9733aa039d513c4495eae1b5104b9f6d7669c7 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 17:40:08 -0700 Subject: [PATCH 32/81] Removed test code. --- cmake/macros/PackageLibrariesForDeployment.cmake | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index fa7f52993b..29f4617a6f 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -36,13 +36,6 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) endif () # add a post-build command to call windeployqt to copy Qt plugins -message("+++++++++++++++++++++++++++++++++++++") -message(STATUS ${TARGET_NAME}) -message(STATUS ${QT_DIR}) -message(STATUS ${TARGET_FILE}) -message(STATUS ${WINDEPLOYQT_COMMAND}) -message(STATUS ${EXTRA_DEPLOY_OPTIONS}) -message("-------------------------------------") add_custom_command( TARGET ${TARGET_NAME} POST_BUILD From c05ac9a5dda9c92930c222bb858538f19999cf5e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 17:51:27 -0700 Subject: [PATCH 33/81] testing. --- cmake/templates/FixupBundlePostBuild.cmake.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/templates/FixupBundlePostBuild.cmake.in b/cmake/templates/FixupBundlePostBuild.cmake.in index bb96fe49f3..3e816433a0 100644 --- a/cmake/templates/FixupBundlePostBuild.cmake.in +++ b/cmake/templates/FixupBundlePostBuild.cmake.in @@ -73,5 +73,10 @@ else() set(PLUGIN_EXTENSION "so") endif() +message("+++++++++") +message(${BUNDLE_PLUGIN_DIR}) +message(${PLUGIN_EXTENSION}) +message("---------") + file(GLOB EXTRA_PLUGINS "${BUNDLE_PLUGIN_DIR}/*.${PLUGIN_EXTENSION}") fixup_bundle("${BUNDLE_EXECUTABLE}" "${EXTRA_PLUGINS}" "@FIXUP_LIBS@" IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe") From 91eacf7d3cb02f577496d1f15b253dd6c7964469 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 18:02:39 -0700 Subject: [PATCH 34/81] Added message to know Qt path. --- cmake/macros/SetupQt.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index fafed63e88..6407aaaf04 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -11,8 +11,11 @@ macro(setup_qt) # if we are in a development build and QT_CMAKE_PREFIX_PATH is specified # then use it, # otherwise, use the vcpkg'ed version - if (RELEASE_TYPE STREQUAL "DEV" AND DEFINED ENV{QT_CMAKE_PREFIX_PATH} ) + if (RELEASE_TYPE STREQUAL "DEV" AND DEFINED ENV{QT_CMAKE_PREFIX_PATH}) + message("Development build and QT_CMAKE_PREFIX_PATH is defined in environment - using this path for Qt") set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) + else() + message(" Using vcpkg'ed version of Qt") endif() # figure out where the qt dir is From db77fda6269cbc4393eb1015aa86bce9214cb5b0 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 07:46:23 -0700 Subject: [PATCH 35/81] testing. --- cmake/macros/PackageLibrariesForDeployment.cmake | 2 +- cmake/templates/FixupBundlePostBuild.cmake.in | 5 ----- tools/qt-builder/README.md | 6 +++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index 29f4617a6f..96305839f3 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -39,7 +39,7 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND CMD /C "SET PATH=%PATH%;${QT_DIR}/bin && ${WINDEPLOYQT_COMMAND}\ + COMMAND CMD /C "SET PATH=%PATH%;BBBBBBBBBBBB/bin && ${WINDEPLOYQT_COMMAND}\ ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" ) diff --git a/cmake/templates/FixupBundlePostBuild.cmake.in b/cmake/templates/FixupBundlePostBuild.cmake.in index 3e816433a0..bb96fe49f3 100644 --- a/cmake/templates/FixupBundlePostBuild.cmake.in +++ b/cmake/templates/FixupBundlePostBuild.cmake.in @@ -73,10 +73,5 @@ else() set(PLUGIN_EXTENSION "so") endif() -message("+++++++++") -message(${BUNDLE_PLUGIN_DIR}) -message(${PLUGIN_EXTENSION}) -message("---------") - file(GLOB EXTRA_PLUGINS "${BUNDLE_PLUGIN_DIR}/*.${PLUGIN_EXTENSION}") fixup_bundle("${BUNDLE_EXECUTABLE}" "${EXTRA_PLUGINS}" "@FIXUP_LIBS@" IGNORE_ITEM "vcredist_x86.exe;vcredist_x64.exe") diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index f3aeb7a497..2cd2b879c7 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -125,9 +125,9 @@ Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* fol `git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` run `..\qt5\qt5vars.bat` `cd ..\..\qt5-build` From bf1d73b413336a566f94c18930b6f5c342acc59b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 08:29:53 -0700 Subject: [PATCH 36/81] Undid testing. --- cmake/macros/PackageLibrariesForDeployment.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index 96305839f3..29f4617a6f 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -39,7 +39,7 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND CMD /C "SET PATH=%PATH%;BBBBBBBBBBBB/bin && ${WINDEPLOYQT_COMMAND}\ + COMMAND CMD /C "SET PATH=%PATH%;${QT_DIR}/bin && ${WINDEPLOYQT_COMMAND}\ ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" ) From 450bc96c39a7573efc696d7a512943e9efa00e93 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 08:53:25 -0700 Subject: [PATCH 37/81] Cleanup. --- tools/qt-builder/README.md | 295 ++++++++++++++++++------------------- 1 file changed, 146 insertions(+), 149 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 2cd2b879c7..312a3d4622 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -15,167 +15,165 @@ Add path to python executable to PATH. NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. -Verify that python runs python 2.7 (run “python --version”) -1. git >= 1.6 -Check if needed `git --version` -Download from https://git-scm.com/download/win -Verify by entering `git --version` -1. perl >= 5.14 -Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ -Verify by running `perl --version` -1. flex and bison -Download from https://sourceforge.net/projects/winflexbison/files/latest/download -Uncompress in C:\flex_bison -Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe -Add C:\flex_bison to PATH -Verify by running `flex --version` -Verify by running `bison --version` -1. gperf -Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Add C:\Program Files (x86)\GnuWin32\bin to PATH -Verify by running `gperf --version` -1. 7-zip -Download from https://www.7-zip.org/download.html -1. Bash shell -From *Settings* select *Update & Security* -Select *For Developers* -Enable *Developer mode* -Restart PC -Open Control Panel and select *Programs and Features* -Select *Turn Windows features on or off* -Check *Windows Subsystem for Linux* -Click *Restart now* -Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version -[First run will take a few minutes] -Enter a user name - all small letters (this is not required for later use) -Choose a password -### Linux -Tested on Ubuntu 18.04 -1. qt5 requirements -edit /etc/apt/sources.list (edit as root) -replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) -`sudo apt-get update -y` -`sudo apt-get upgrade -y` -`sudo apt-get build-dep qt5-default -y` -1. git >= 1.6 -Check if needed `git --version` -`sudo apt-get install git -y` -Verify again -1. python -Check if needed `python --version` - should return python 2.7.x -`sudo apt-get install python -y` (not python 3!) -Verify again -1. gperf -Check if needed `gperf --version` -`sudo apt-get install gperf -y` -Verify again -1. bison and flex -Check if needed `flex --version` and `bison --version` -`sudo apt-get install flex bison -y` -Verify again -1. pkg-config (needed for qtwebengine) -Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again -1. OpenGL -Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install libgl1-mesa-dev -y` -`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again -1. make -Check if needed `make --version` -`sudo apt-get install make -y` -Verify again -1. g++ -Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again -1. dbus-1 (needed for qtwebengine) -`sudo apt-get install libdbus-glib-1-dev -y` -1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` -### Mac -1. git >= 1.6 -Check if needed `git --version` -Install from https://git-scm.com/download/mac -Verify again -1. pkg-config -brew fontconfig dbus-glib stall pkg-config -1. dbus-1 -brew install dbus-glib +Verify that python runs python 2.7 (run “python --version”) +1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win +Verify by entering `git --version` +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +Verify by running `perl --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` +Verify by running `bison --version` +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Add C:\Program Files (x86)\GnuWin32\bin to PATH +Verify by running `gperf --version` +1. 7-zip +Download from https://www.7-zip.org/download.html +1. Bash shell +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* +Click *Restart now* +Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version +[First run will take a few minutes] +Enter a user name - all small letters (this is used for *sudo* commands) +Choose a password +### Linux +Tested on Ubuntu 18.04 +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +`sudo apt-get build-dep qt5-default -y` +1. git >= 1.6 +Check if needed `git --version` +`sudo apt-get install git -y` +Verify again +1. python +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) +Verify again +1. gperf +Check if needed `gperf --version` +`sudo apt-get install gperf -y` +Verify again +1. bison and flex +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` +Verify again +1. pkg-config (needed for qtwebengine) +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again +1. g++ +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install libdbus-glib-1-dev -y` +1. nss (needed for qtwebengine) +`sudo apt-get install libnss3-dev -y` +### Mac +1. git >= 1.6 +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again +1. pkg-config +brew fontconfig dbus-glib stall pkg-config +1. dbus-1 +brew install dbus-glib ## Build Process ### General -qt is cloned to the qt5 folder. -The build is performed in the qt5-build folder. -Build products are installed to the qt5-install folder. -Before running configure, make sure that the qt5-build folder is empty. +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. +Before running configure, make sure that the qt5-build folder is empty. -**Only run the patches once!!!** +**Only run the patches once!!!** ### Windows -Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. +If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. #### Preparing source files -`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Copy the **qt5vars.bat** file to qt5 -* Apply the two patches to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` #### Configuring `mkdir qt5-install` `mkdir qt5-build` `cd qt5-build` -run `..\qt5\qt5vars.bat` -`cd ..\..\qt5-build` +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` +`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make `nmake` -`nmake install` +`nmake install` #### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -1. Open a bash terminal -1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) -1. Run the following command -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +1. Open a bash terminal +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` #### Uploading -Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux #### Preparing source files -`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` - -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` -`make install` +`make install` #### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` #### Uploading -1. Return to the home folder -`cd ..` - -1. Open a python 3 shell -`python3` - +1. Return to the home folder +`cd ..` +1. Open a python 3 shell +`python3` 1. Run the following snippet: `import os` `import tarfile` @@ -183,28 +181,27 @@ The *.prl* files have an absolute path that needs to be removed (see http://www. `filename.add("qt5-install", os.path.basename("qt5-install"))` `exit()` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac #### Preparing source files -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd ../qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` -`make install` -#### Fixing +`make install` #### Uploading `tar -zcvf qt5-install.tar.gz qt5-install` -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From 90d7948e0d0aa89e6233839296a2ca744a90b4ab Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 09:01:10 -0700 Subject: [PATCH 38/81] TEST --- CMakeLists.txt | 3 ++- cmake/externals/quazip/CMakeLists.txt | 2 ++ cmake/macros/SetupQt.cmake | 2 ++ hifi_vcpkg.py | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c8792d87ad..964d00b37d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,7 +192,8 @@ set_packaging_parameters() # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}") - +message("=========================================================================TOP CMakeLists") +message(${QT_CMAKE_PREFIX_PATH}) find_package( Threads ) add_definitions(-DGLM_FORCE_RADIANS) diff --git a/cmake/externals/quazip/CMakeLists.txt b/cmake/externals/quazip/CMakeLists.txt index f99d995a0c..4785fadd40 100644 --- a/cmake/externals/quazip/CMakeLists.txt +++ b/cmake/externals/quazip/CMakeLists.txt @@ -11,6 +11,8 @@ set(QUAZIP_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DZLIB_ROOT=${VCPKG_INSTALL_ROOT} -DCMAKE_POSITION_INDEPENDENT_CODE=ON) +message("=========================================================================Quazip CMakeList") +message(${QT_CMAKE_PREFIX_PATH}) if (NOT APPLE) set(QUAZIP_CMAKE_ARGS ${QUAZIP_CMAKE_ARGS} -DCMAKE_CXX_STANDARD=11) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 6407aaaf04..76b437b397 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -43,5 +43,7 @@ macro(setup_qt) if (WIN32) add_paths_to_fixup_libs("${QT_DIR}/bin") endif () +message("=========================================================================SetupQtMake") +message(${QT_CMAKE_PREFIX_PATH}) endmacro() \ No newline at end of file diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index e1d509b9df..d449de8fa1 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -219,6 +219,8 @@ endif() installPath = os.path.join(self.path, 'installed', self.triplet) toolsPath = os.path.join(self.path, 'installed', self.hostTriplet, 'tools') cmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') + print("==========================================================hifi_vcpkg") + print(cmakePrefixPath) cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE if not self.args.android: cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID From 9b22614135cee1a22c36f1e00c0fef8486e9e0c7 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 10:16:15 -0700 Subject: [PATCH 39/81] Removed test code. --- CMakeLists.txt | 3 +-- cmake/externals/quazip/CMakeLists.txt | 2 -- cmake/macros/SetupQt.cmake | 2 -- hifi_vcpkg.py | 2 -- 4 files changed, 1 insertion(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 964d00b37d..c8792d87ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,8 +192,7 @@ set_packaging_parameters() # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}") -message("=========================================================================TOP CMakeLists") -message(${QT_CMAKE_PREFIX_PATH}) + find_package( Threads ) add_definitions(-DGLM_FORCE_RADIANS) diff --git a/cmake/externals/quazip/CMakeLists.txt b/cmake/externals/quazip/CMakeLists.txt index 4785fadd40..f99d995a0c 100644 --- a/cmake/externals/quazip/CMakeLists.txt +++ b/cmake/externals/quazip/CMakeLists.txt @@ -11,8 +11,6 @@ set(QUAZIP_CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} -DZLIB_ROOT=${VCPKG_INSTALL_ROOT} -DCMAKE_POSITION_INDEPENDENT_CODE=ON) -message("=========================================================================Quazip CMakeList") -message(${QT_CMAKE_PREFIX_PATH}) if (NOT APPLE) set(QUAZIP_CMAKE_ARGS ${QUAZIP_CMAKE_ARGS} -DCMAKE_CXX_STANDARD=11) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 76b437b397..6407aaaf04 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -43,7 +43,5 @@ macro(setup_qt) if (WIN32) add_paths_to_fixup_libs("${QT_DIR}/bin") endif () -message("=========================================================================SetupQtMake") -message(${QT_CMAKE_PREFIX_PATH}) endmacro() \ No newline at end of file diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index d449de8fa1..e1d509b9df 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -219,8 +219,6 @@ endif() installPath = os.path.join(self.path, 'installed', self.triplet) toolsPath = os.path.join(self.path, 'installed', self.hostTriplet, 'tools') cmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') - print("==========================================================hifi_vcpkg") - print(cmakePrefixPath) cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE if not self.args.android: cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID From 230493035d4731f9af2e13833653f9a3cd151ac4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 14:28:11 -0700 Subject: [PATCH 40/81] To update the vcpkg Qt. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index e1d509b9df..7bc35b28c3 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if True or 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': From 5aff0bf3e9580c963a5a7d881b47c88a7066b9d8 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Thu, 25 Apr 2019 15:07:34 -0700 Subject: [PATCH 41/81] Make sure vcpkg'ed version of windeployqt.exe is used. --- cmake/macros/PackageLibrariesForDeployment.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index 29f4617a6f..b3f725b2b0 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -39,7 +39,7 @@ macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) add_custom_command( TARGET ${TARGET_NAME} POST_BUILD - COMMAND CMD /C "SET PATH=%PATH%;${QT_DIR}/bin && ${WINDEPLOYQT_COMMAND}\ + COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" ) From 08ca27bf42076615f0a4032d1400691ce93140ac Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 26 Apr 2019 15:30:00 -0700 Subject: [PATCH 42/81] Add qt.conf and updated README.md --- tools/qt-builder/README.md | 3 ++- tools/qt-builder/qt.conf | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 tools/qt-builder/qt.conf diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 312a3d4622..0a8c4d18b1 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -143,6 +143,7 @@ The *.prl* files have an absolute path that needs to be removed (see http://www. 1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) 1. Run the following command ` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) @@ -161,7 +162,7 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `mkdir qt5-build` `cd qt5-build` -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt=libpng -qt-xcb -qt-freetype [qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` `make install` diff --git a/tools/qt-builder/qt.conf b/tools/qt-builder/qt.conf new file mode 100644 index 0000000000..01f4e8c707 --- /dev/null +++ b/tools/qt-builder/qt.conf @@ -0,0 +1,2 @@ +[Paths] +Prefix=.. From ced1f7d82b905573d91e4bafb75a693404e8f1b9 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 26 Apr 2019 15:30:40 -0700 Subject: [PATCH 43/81] Typo --- tools/qt-builder/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 0a8c4d18b1..41d59b3ec9 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -162,7 +162,7 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `mkdir qt5-build` `cd qt5-build` -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt=libpng -qt-xcb -qt-freetype [qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` `make install` From b84f8110f0984ec63fc4c1c2b72bc28f4d7d091d Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 26 Apr 2019 15:53:38 -0700 Subject: [PATCH 44/81] Updated for Mac. --- tools/qt-builder/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 41d59b3ec9..4159915ab0 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -197,7 +197,7 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch `mkdir qt5-build` `cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` `make install` From 6f7cc6d07f932df5d78be550adcc6361983916a8 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 26 Apr 2019 16:27:02 -0700 Subject: [PATCH 45/81] Corrected README.md for Mac. --- tools/qt-builder/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 4159915ab0..a3df8e60e1 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -197,7 +197,7 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch `mkdir qt5-build` `cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` `make install` From 03b4d1b4728fb6e4b49eb0944ea94c70e2246fb4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 27 Apr 2019 11:00:15 -0700 Subject: [PATCH 46/81] Updated readme. --- tools/qt-builder/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index a3df8e60e1..2012cf7d7c 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -167,9 +167,10 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `make` `make install` #### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) `cd ../qt5-install` ` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading 1. Return to the home folder `cd ..` @@ -201,6 +202,11 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch #### Make `make` `make install` +#### Fixing +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading `tar -zcvf qt5-install.tar.gz qt5-install` Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ From 88f2cfa96513fe2ca4f51962a4b8622b5b6bdfe0 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 27 Apr 2019 22:22:57 -0700 Subject: [PATCH 47/81] Updated for Ubuntu 16.04 --- tools/qt-builder/README.md | 330 ++++++++++++++++++------------------- 1 file changed, 165 insertions(+), 165 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 2012cf7d7c..4c8399ab13 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -15,200 +15,200 @@ Add path to python executable to PATH. NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. -Verify that python runs python 2.7 (run “python --version”) -1. git >= 1.6 -Check if needed `git --version` -Download from https://git-scm.com/download/win -Verify by entering `git --version` -1. perl >= 5.14 -Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ -Verify by running `perl --version` -1. flex and bison -Download from https://sourceforge.net/projects/winflexbison/files/latest/download -Uncompress in C:\flex_bison -Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe -Add C:\flex_bison to PATH -Verify by running `flex --version` -Verify by running `bison --version` -1. gperf -Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Add C:\Program Files (x86)\GnuWin32\bin to PATH -Verify by running `gperf --version` -1. 7-zip -Download from https://www.7-zip.org/download.html -1. Bash shell -From *Settings* select *Update & Security* -Select *For Developers* -Enable *Developer mode* -Restart PC -Open Control Panel and select *Programs and Features* -Select *Turn Windows features on or off* -Check *Windows Subsystem for Linux* -Click *Restart now* -Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version -[First run will take a few minutes] -Enter a user name - all small letters (this is used for *sudo* commands) -Choose a password -### Linux -Tested on Ubuntu 18.04 -1. qt5 requirements -edit /etc/apt/sources.list (edit as root) -replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) -`sudo apt-get update -y` -`sudo apt-get upgrade -y` -`sudo apt-get build-dep qt5-default -y` -1. git >= 1.6 -Check if needed `git --version` -`sudo apt-get install git -y` -Verify again -1. python -Check if needed `python --version` - should return python 2.7.x -`sudo apt-get install python -y` (not python 3!) -Verify again -1. gperf -Check if needed `gperf --version` -`sudo apt-get install gperf -y` -Verify again -1. bison and flex -Check if needed `flex --version` and `bison --version` -`sudo apt-get install flex bison -y` -Verify again -1. pkg-config (needed for qtwebengine) -Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again -1. OpenGL -Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install libgl1-mesa-dev -y` -`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again -1. make -Check if needed `make --version` -`sudo apt-get install make -y` -Verify again -1. g++ -Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again -1. dbus-1 (needed for qtwebengine) -`sudo apt-get install libdbus-glib-1-dev -y` -1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` -### Mac -1. git >= 1.6 -Check if needed `git --version` -Install from https://git-scm.com/download/mac -Verify again -1. pkg-config -brew fontconfig dbus-glib stall pkg-config -1. dbus-1 -brew install dbus-glib +Verify that python runs python 2.7 (run “python --version”) +1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win +Verify by entering `git --version` +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +Verify by running `perl --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` +Verify by running `bison --version` +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Add C:\Program Files (x86)\GnuWin32\bin to PATH +Verify by running `gperf --version` +1. 7-zip +Download from https://www.7-zip.org/download.html +1. Bash shell +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* +Click *Restart now* +Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version +[First run will take a few minutes] +Enter a user name - all small letters (this is used for *sudo* commands) +Choose a password +### Linux +Tested on Ubuntu 18.04 +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +`sudo apt-get build-dep qt5-default -y` +1. git >= 1.6 +Check if needed `git --version` +`sudo apt-get install git -y` +Verify again +1. python +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) +Verify again +1. gperf +Check if needed `gperf --version` +`sudo apt-get install gperf -y` +Verify again +1. bison and flex +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` +Verify again +1. pkg-config (needed for qtwebengine) +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again +1. g++ +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install libdbus-glib-1-dev -y` +1. nss (needed for qtwebengine) +`sudo apt-get install libnss3-dev -y` +### Mac +1. git >= 1.6 +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again +1. pkg-config +brew fontconfig dbus-glib stall pkg-config +1. dbus-1 +brew install dbus-glib ## Build Process ### General -qt is cloned to the qt5 folder. -The build is performed in the qt5-build folder. -Build products are installed to the qt5-install folder. -Before running configure, make sure that the qt5-build folder is empty. +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. +Before running configure, make sure that the qt5-build folder is empty. -**Only run the patches once!!!** +**Only run the patches once!!!** ### Windows -Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. -If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. +If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. #### Preparing source files -`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Copy the **qt5vars.bat** file to qt5 -* Apply the two patches to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -run `..\qt5\qt5vars.bat` -`cd ..\..\qt5-build` +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` +`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make -`nmake` -`nmake install` +`nmake` +`nmake install` #### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -1. Open a bash terminal -1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) -1. Run the following command -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +1. Open a bash terminal +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux #### Preparing source files -`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -1. Return to the home folder -`cd ..` -1. Open a python 3 shell -`python3` -1. Run the following snippet: -`import os` -`import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` -`filename.add("qt5-install", os.path.basename("qt5-install"))` -`exit()` +1. Return to the home folder +`cd ..` +1. Open a python 3 shell +`python3` +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac #### Preparing source files -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd ../qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -`tar -zcvf qt5-install.tar.gz qt5-install` -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ +`tar -zcvf qt5-install.tar.gz qt5-install` +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From 79f73cf06c5bd2c4b7947faf42201037c341b1e1 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 27 Apr 2019 22:52:55 -0700 Subject: [PATCH 48/81] Minor cleanup --- tools/qt-builder/README.md | 344 +++++++++++++++++++------------------ 1 file changed, 173 insertions(+), 171 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 4c8399ab13..fc7cf7062a 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -1,214 +1,216 @@ # General This document describes the process to build Qt 5.12.3. -Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. +Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. The second patch is to OpenSL ES audio. ## Requirements ### Windows -1. Visual Studio 2017 - If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). +1. Visual Studio 2017 + If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). Install with defaults 1. python 2.7.16 -Check if needed running `python --version` - should return python 2.7.x -Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi +Check if needed running `python --version` - should return python 2.7.x +Install from https://www.python.org/ftp/python/2.7.16/python-2.7.16.amd64.msi Add path to python executable to PATH. NOTE: REMOVE python 3 from PATH. Our regular build uses python 3. This will still work, because HIFI_PYTHON_EXEC points to the python 3 executable. -Verify that python runs python 2.7 (run “python --version”) -1. git >= 1.6 -Check if needed `git --version` -Download from https://git-scm.com/download/win -Verify by entering `git --version` -1. perl >= 5.14 -Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ -Verify by running `perl --version` -1. flex and bison -Download from https://sourceforge.net/projects/winflexbison/files/latest/download -Uncompress in C:\flex_bison -Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe -Add C:\flex_bison to PATH -Verify by running `flex --version` -Verify by running `bison --version` -1. gperf -Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php -Add C:\Program Files (x86)\GnuWin32\bin to PATH -Verify by running `gperf --version` -1. 7-zip -Download from https://www.7-zip.org/download.html -1. Bash shell -From *Settings* select *Update & Security* -Select *For Developers* -Enable *Developer mode* -Restart PC -Open Control Panel and select *Programs and Features* -Select *Turn Windows features on or off* -Check *Windows Subsystem for Linux* -Click *Restart now* -Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version -[First run will take a few minutes] -Enter a user name - all small letters (this is used for *sudo* commands) -Choose a password +Verify that python runs python 2.7 (run “python --version”) +1. git >= 1.6 +Check if needed `git --version` +Download from https://git-scm.com/download/win +Verify by entering `git --version` +1. perl >= 5.14 +Install from Strawberry Perl - http://strawberryperl.com/ - 5.28.1.1 64 bit to C:\Strawberry\ +Verify by running `perl --version` +1. flex and bison +Download from https://sourceforge.net/projects/winflexbison/files/latest/download +Uncompress in C:\flex_bison +Rename win-bison.exe to bison.exe and win-flex.exe to flex.exe +Add C:\flex_bison to PATH +Verify by running `flex --version` +Verify by running `bison --version` +1. gperf +Install from http://gnuwin32.sourceforge.net/downlinks/gperf.php +Add C:\Program Files (x86)\GnuWin32\bin to PATH +Verify by running `gperf --version` +1. 7-zip +Download from https://www.7-zip.org/download.html +1. Bash shell +From *Settings* select *Update & Security* +Select *For Developers* +Enable *Developer mode* +Restart PC +Open Control Panel and select *Programs and Features* +Select *Turn Windows features on or off* +Check *Windows Subsystem for Linux* +Click *Restart now* +Download from the Microsoft Store - Search for *bash* and choose the latest Ubuntu version +[First run will take a few minutes] +Enter a user name - all small letters (this is used for *sudo* commands) +Choose a password ### Linux -Tested on Ubuntu 18.04 -1. qt5 requirements -edit /etc/apt/sources.list (edit as root) -replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) -`sudo apt-get update -y` -`sudo apt-get upgrade -y` -`sudo apt-get build-dep qt5-default -y` -1. git >= 1.6 -Check if needed `git --version` -`sudo apt-get install git -y` -Verify again -1. python -Check if needed `python --version` - should return python 2.7.x -`sudo apt-get install python -y` (not python 3!) -Verify again -1. gperf -Check if needed `gperf --version` -`sudo apt-get install gperf -y` -Verify again -1. bison and flex -Check if needed `flex --version` and `bison --version` -`sudo apt-get install flex bison -y` -Verify again -1. pkg-config (needed for qtwebengine) -Check if needed `pkg-config --version` -`sudo apt-get install pkg-config -y` -Verify again -1. OpenGL -Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` -`sudo apt-get install libgl1-mesa-dev -y` -`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` -Verify again -1. make -Check if needed `make --version` -`sudo apt-get install make -y` -Verify again -1. g++ -Check if needed - `g++ --version` -`sudo apt-get install g++ -y` -Verify again -1. dbus-1 (needed for qtwebengine) -`sudo apt-get install libdbus-glib-1-dev -y` -1. nss (needed for qtwebengine) -`sudo apt-get install libnss3-dev -y` +Tested on Ubuntu 16.04 and 18.04. +**16.04 NEEDED FOR JENKINS~~ ** +1. qt5 requirements +edit /etc/apt/sources.list (edit as root) +replace all *# deb-src* with *deb-src* (in vi `1,$s/# deb-src/deb-src/`) +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +`sudo apt-get build-dep qt5-default -y` +1. git >= 1.6 +Check if needed `git --version` +`sudo apt-get install git -y` +Verify again +1. python +Check if needed `python --version` - should return python 2.7.x +`sudo apt-get install python -y` (not python 3!) +Verify again +1. gperf +Check if needed `gperf --version` +`sudo apt-get install gperf -y` +Verify again +1. bison and flex +Check if needed `flex --version` and `bison --version` +`sudo apt-get install flex bison -y` +Verify again +1. pkg-config (needed for qtwebengine) +Check if needed `pkg-config --version` +`sudo apt-get install pkg-config -y` +Verify again +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` +Verify again +1. make +Check if needed `make --version` +`sudo apt-get install make -y` +Verify again +1. g++ +Check if needed + `g++ --version` +`sudo apt-get install g++ -y` +Verify again +1. dbus-1 (needed for qtwebengine) +`sudo apt-get install libdbus-glib-1-dev -y` +1. nss (needed for qtwebengine) +`sudo apt-get install libnss3-dev -y` ### Mac -1. git >= 1.6 -Check if needed `git --version` -Install from https://git-scm.com/download/mac -Verify again -1. pkg-config -brew fontconfig dbus-glib stall pkg-config -1. dbus-1 -brew install dbus-glib +1. git >= 1.6 +Check if needed `git --version` +Install from https://git-scm.com/download/mac +Verify again +1. pkg-config +brew fontconfig dbus-glib stall pkg-config +1. dbus-1 +brew install dbus-glib ## Build Process ### General -qt is cloned to the qt5 folder. -The build is performed in the qt5-build folder. -Build products are installed to the qt5-install folder. -Before running configure, make sure that the qt5-build folder is empty. +qt is cloned to the qt5 folder. +The build is performed in the qt5-build folder. +Build products are installed to the qt5-install folder. +Before running configure, make sure that the qt5-build folder is empty. -**Only run the patches once!!!** +**Only run the patches once!!!** ### Windows -Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. -If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. +Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. +If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. #### Preparing source files -`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` +`git clone --recursive https://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` + +* Copy the **patches** folder to qt5 +* Copy the **qt5vars.bat** file to qt5 +* Apply the two patches to Qt -* Copy the **patches** folder to qt5 -* Copy the **qt5vars.bat** file to qt5 -* Apply the two patches to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` -#### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/qfloat16.patch` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` +#### Configuring +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -run `..\qt5\qt5vars.bat` -`cd ..\..\qt5-build` +run `..\qt5\qt5vars.bat` +`cd ..\..\qt5-build` -`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` +`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make -`nmake` -`nmake install` +`nmake` +`nmake install` #### Fixing -The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -1. Open a bash terminal -1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) -1. Run the following command -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +1. Open a bash terminal +1. `cd` to the *qt5-install* folder (e.g. `cd /mnt/d/qt5-install/`) +1. Run the following command +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) -Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ +Create a tar file called qt5-install.tar from the qt5-install folder (e.g. using 7-zip) +Create a gzip file called qt5-install.tar.gz from the qt5-install.tar file just created (e.g. using 7-zip) +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ ### Linux #### Preparing source files -`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` - -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch` + +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` `cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd qt5-build` -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -1. Return to the home folder -`cd ..` -1. Open a python 3 shell -`python3` -1. Run the following snippet: -`import os` -`import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` -`filename.add("qt5-install", os.path.basename("qt5-install"))` -`exit()` +1. Return to the home folder +`cd ..` +1. Open a python 3 shell +`python3` +1. Run the following snippet: +`import os` +`import tarfile` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` +`exit()` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ ### Mac #### Preparing source files -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch - -* Copy the **patches** folder to qt5 -* Apply one patch to Qt -`cd qt5` -`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` -`cd ..` +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch + +* Copy the **patches** folder to qt5 +* Apply one patch to Qt +`cd qt5` +`git apply --ignore-space-change --ignore-whitespace patches/aec.patch` +`cd ..` #### Configuring -`mkdir qt5-install` -`mkdir qt5-build` -`cd ../qt5-build` +`mkdir qt5-install` +`mkdir qt5-build` +`cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make -`make` -`make install` +`make` +`make install` #### Fixing -1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) -`cd ../qt5-install` -` find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` -1. Copy *qt.conf* to *qt5-install\bin* +1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) +`cd ../qt5-install` +`find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +1. Copy *qt.conf* to *qt5-install\bin* #### Uploading -`tar -zcvf qt5-install.tar.gz qt5-install` -Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ +`tar -zcvf qt5-install.tar.gz qt5-install` +Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Mac/ ## Problems *configure* errors, if any, may be viewed in **config.log** and **config.summary** From 67fb5efa37e3f0a8a91931489818b59028a81ebe Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 28 Apr 2019 18:25:00 -0700 Subject: [PATCH 49/81] Do not always download Qt. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 7bc35b28c3..e1d509b9df 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + 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': From 7eaa45f5c178fc55ccccf5be6fc441932c6f9368 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 12:33:23 -0700 Subject: [PATCH 50/81] Added macdeployqt to local builds. --- BUILD.md | 20 ++- BUILD_LINUX.md | 23 ++-- BUILD_OSX.md | 12 +- BUILD_WIN.md | 18 +-- cmake/macros/FixupInterface.cmake | 4 +- cmake/macros/FixupNitpick.cmake | 4 +- .../PackageLibrariesForDeployment.cmake | 118 ++++++++++-------- tools/qt-builder/README.md | 2 +- 8 files changed, 93 insertions(+), 108 deletions(-) diff --git a/BUILD.md b/BUILD.md index 25bbc89951..435ca74619 100644 --- a/BUILD.md +++ b/BUILD.md @@ -8,7 +8,7 @@ ### Dependencies - [cmake](https://cmake.org/download/): 3.9 -- [Qt](https://www.qt.io/download-open-source): 5.10.1 +- [Qt](https://www.qt.io/download-open-source): 5.12.3 - [Python](https://www.python.org/downloads/): 3.6 or higher ### CMake External Project Dependencies @@ -36,16 +36,14 @@ These are not placed in your normal build tree when doing an out of source build Hifi uses CMake to generate build files and project files for your platform. #### Qt +CMake will download Qt 5.12.3 using vcpkg. -In order for CMake to find the Qt5 find modules, you will need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt installation. +To override this (i.e. use an installed Qt configuration - you will need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt **lib/cmake** folder. +This can either be entered directly into your shell session before you build or in your shell profile (e.g.: ~/.bash_profile, ~/.bashrc, ~/.zshrc - this depends on your shell and environment). The path it needs to be set to will depend on where and how Qt5 was installed. e.g. -This can either be entered directly into your shell session before you build or in your shell profile (e.g.: ~/.bash_profile, ~/.bashrc, ~/.zshrc - this depends on your shell and environment). - -The path it needs to be set to will depend on where and how Qt5 was installed. e.g. - - export QT_CMAKE_PREFIX_PATH=/usr/local/Qt5.10.1/5.10.1/gcc_64/lib/cmake - export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.10.1/clang_64/lib/cmake/ - export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.10.1/lib/cmake + export QT_CMAKE_PREFIX_PATH=/usr/local/Qt5.12.3/gcc_64/lib/cmake + export QT_CMAKE_PREFIX_PATH=/usr/local/qt/5.12.3/clang_64/lib/cmake/ + export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.12.3/lib/cmake export QT_CMAKE_PREFIX_PATH=/usr/local/opt/qt5/lib/cmake #### Vcpkg @@ -68,13 +66,13 @@ Create a build directory in the root of your checkout and then run the CMake bui cd build cmake .. -If cmake gives you the same error message repeatedly after the build fails (e.g. you had a typo in the QT_CMAKE_PREFIX_PATH that you fixed but the `.cmake` files still cannot be found), try removing `CMakeCache.txt`. +If cmake gives you the same error message repeatedly after the build fails, try removing `CMakeCache.txt`. #### Variables Any variables that need to be set for CMake to find dependencies can be set as ENV variables in your shell profile, or passed directly to CMake with a `-D` flag appended to the `cmake ..` command. -For example, to pass the QT_CMAKE_PREFIX_PATH variable during build file generation: +For example, to pass the QT_CMAKE_PREFIX_PATH variable (if not using the vcpkg'ed version) during build file generation: cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.10.1/lib/cmake diff --git a/BUILD_LINUX.md b/BUILD_LINUX.md index 8820bda8f6..6b274b7f5b 100644 --- a/BUILD_LINUX.md +++ b/BUILD_LINUX.md @@ -19,23 +19,19 @@ sudo apt-get update ``` ### Prepare environment -Install Qt 5.10.1: -```bash -wget http://debian.highfidelity.com/pool/h/hi/hifiqt5.10.1_5.10.1_amd64.deb -sudo dpkg -i hifiqt5.10.1_5.10.1_amd64.deb -``` - -Install build dependencies: +Add the following line to *.bash_profile* +`export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/` +#### Install build dependencies: ```bash sudo apt-get install libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack0 libjack-dev libxrandr-dev libudev-dev libssl-dev zlib1g-dev ``` -To compile interface in a server you must install: +#### To compile interface in a server you must install: ```bash sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1 ``` -Install build tools: +#### Install build tools: ```bash # For Ubuntu 18.04 sudo apt-get install cmake @@ -46,14 +42,11 @@ wget https://cmake.org/files/v3.9/cmake-3.9.5-Linux-x86_64.sh sudo sh cmake-3.9.5-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir ``` -Install Python 3: +#### Install Python 3: ```bash -sudo apt-get install python3.6 +sudo apt-get install python3 ``` - - ### Get code and checkout the tag you need - Clone this repository: ```bash git clone https://github.com/highfidelity/hifi.git @@ -80,7 +73,7 @@ cd hifi/build Prepare makefiles: ```bash -cmake -DQT_CMAKE_PREFIX_PATH=/usr/local/Qt5.10.1/5.10.1/gcc_64/lib/cmake .. +cmake .. ``` Start compilation of the server and get a cup of coffee: diff --git a/BUILD_OSX.md b/BUILD_OSX.md index 488c38e909..181ae29022 100644 --- a/BUILD_OSX.md +++ b/BUILD_OSX.md @@ -4,7 +4,7 @@ Please read the [general build guide](BUILD.md) for information on dependencies [Homebrew](https://brew.sh/) is an excellent package manager for macOS. It makes install of some High Fidelity dependencies very simple. - brew install cmake openssl qt + brew install cmake openssl ### Python 3 @@ -18,16 +18,6 @@ For OpenSSL installed via homebrew, set OPENSSL_ROOT_DIR: export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2l Note that this uses the version from the homebrew formula at the time of this writing, and the version in the path will likely change. - -### Qt - -Assuming you've installed Qt using the homebrew instructions above, you'll need to set QT_CMAKE_PREFIX_PATH so CMake can find your installations. -For Qt installed via homebrew, set QT_CMAKE_PREFIX_PATH: - - export QT_CMAKE_PREFIX_PATH=/usr/local/Cellar/qt/5.10.1/lib/cmake - -Note that this uses the version from the homebrew formula at the time of this writing, and the version in the path will likely change. - ### Xcode If Xcode is your editor of choice, you can ask CMake to generate Xcode project files instead of Unix Makefiles. diff --git a/BUILD_WIN.md b/BUILD_WIN.md index a8726b0a23..c9938fd3f3 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -1,7 +1,6 @@ -This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit. - +This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit. ## Building High Fidelity -Note: We are now using Visual Studio 2017 and Qt 5.10.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide. +Note: We are now using Visual Studio 2017 and Qt 5.10.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide. Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory. @@ -22,19 +21,6 @@ If you do not wish to use the Python installation bundled with Visual Studio, yo Download and install the latest version of CMake 3.9. Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted. - -### Step 3. Installing Qt - -Download and install the [Qt Open Source Online Installer](https://www.qt.io/download-open-source/?hsCtaTracking=f977210e-de67-475f-a32b-65cec207fd03%7Cd62710cd-e1db-46aa-8d4d-2f1c1ffdacea). While installing, you only need to have the following components checked under Qt 5.10.1: "msvc2017 64-bit", "Qt WebEngine", and "Qt Script (Deprecated)". - -Note: Installing the Sources is optional but recommended if you have room for them (~2GB). - -### Step 4. Setting Qt Environment Variable - -Go to `Control Panel > System > Advanced System Settings > Environment Variables > New...` (or search “Environment Variables” in Start Search). -* Set "Variable name": `QT_CMAKE_PREFIX_PATH` -* Set "Variable value": `C:\Qt\5.10.1\msvc2017_64\lib\cmake` - ### Step 5. Running CMake to Generate Build Files Run Command Prompt from Start and run the following commands: diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index 93b5cc25fb..d08ad2ac41 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -18,10 +18,10 @@ macro(fixup_interface) find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + if (NOT MACDEPLOYQT_COMMAND) message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ It is required to produce an relocatable interface application.\ - Check that the environment variable QT_DIR points to your Qt installation.\ + Check that the variable QT_DIR points to your Qt installation.\ ") endif () diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 8477b17823..97ad313000 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -17,10 +17,10 @@ macro(fixup_nitpick) find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + if (NOT MACDEPLOYQT_COMMAND) message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ It is required to produce a relocatable nitpick application.\ - Check that the environment variable QT_DIR points to your Qt installation.\ + Check that the variable QT_DIR points to your Qt installation.\ ") endif () diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index b3f725b2b0..f6963f9d82 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -10,59 +10,77 @@ # macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) - if (WIN32) - configure_file( - ${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake - @ONLY - ) + if (WIN32) + configure_file( + ${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake + @ONLY + ) - set(PLUGIN_PATH "plugins") + set(PLUGIN_PATH "plugins") - # add a post-build command to copy DLLs beside the executable - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - -DBUNDLE_EXECUTABLE="$" - -DBUNDLE_PLUGIN_DIR="$/${PLUGIN_PATH}" - -P "${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake" - ) + # add a post-build command to copy DLLs beside the executable + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + -DBUNDLE_EXECUTABLE="$" + -DBUNDLE_PLUGIN_DIR="$/${PLUGIN_PATH}" + -P "${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake" + ) - find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH) + find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH) - if (NOT WINDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.") + if (NOT WINDEPLOYQT_COMMAND) + message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.") + endif () + + # add a post-build command to call windeployqt to copy Qt plugins + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ + ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ + --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" + ) + + set(QTAUDIO_PATH "$/audio") + set(QTAUDIO_WIN7_PATH "$/audioWin7/audio") + set(QTAUDIO_WIN8_PATH "$/audioWin8/audio") + + # copy qtaudio_wasapi.dll and qtaudio_windows.dll in the correct directories for runtime selection + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN7_PATH}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN8_PATH}" + # copy release DLLs + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windows.dll" "${QTAUDIO_WIN7_PATH}" ) + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapi.dll" "${QTAUDIO_WIN8_PATH}" ) + # copy debug DLLs + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windowsd.dll" "${QTAUDIO_WIN7_PATH}" ) + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapid.dll" "${QTAUDIO_WIN8_PATH}" ) + # remove directory + COMMAND ${CMAKE_COMMAND} -E remove_directory "${QTAUDIO_PATH}" + ) + elseif (APPLE) + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + + if (NOT MACDEPLOYQT_COMMAND) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin. macdeployqt is required.") + endif () + + # add a post-build command to call macdeployqt to copy Qt plugins + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + (COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + ) + + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ + ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ + --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" + ) endif () - - # add a post-build command to call windeployqt to copy Qt plugins - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ - ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ - --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" - ) - - set(QTAUDIO_PATH "$/audio") - set(QTAUDIO_WIN7_PATH "$/audioWin7/audio") - set(QTAUDIO_WIN8_PATH "$/audioWin8/audio") - - # copy qtaudio_wasapi.dll and qtaudio_windows.dll in the correct directories for runtime selection - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN7_PATH}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN8_PATH}" - # copy release DLLs - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windows.dll" "${QTAUDIO_WIN7_PATH}" ) - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapi.dll" "${QTAUDIO_WIN8_PATH}" ) - # copy debug DLLs - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windowsd.dll" "${QTAUDIO_WIN7_PATH}" ) - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapid.dll" "${QTAUDIO_WIN8_PATH}" ) - # remove directory - COMMAND ${CMAKE_COMMAND} -E remove_directory "${QTAUDIO_PATH}" - ) - - endif () endmacro() diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index fc7cf7062a..b23a691e3a 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -1,6 +1,6 @@ # General This document describes the process to build Qt 5.12.3. -Note that there are two patches. The first (to qfloat16.h) is needed to compiel QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. +Note that there are two patches. The first (to qfloat16.h) is needed to compile QT 5.12.3 on Visual Studio 2017 due to a bug in Visual Studio (*bitset* will not compile. Note that there is a change in CMakeLists.txt to support this. The second patch is to OpenSL ES audio. ## Requirements ### Windows From 52636564a1a0818e5de27680f76243cd28daf85c Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 12:36:02 -0700 Subject: [PATCH 51/81] Added macdeployqt to local builds for nitpick. --- tools/nitpick/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/nitpick/CMakeLists.txt b/tools/nitpick/CMakeLists.txt index 44eace5e70..6076f80c16 100644 --- a/tools/nitpick/CMakeLists.txt +++ b/tools/nitpick/CMakeLists.txt @@ -195,5 +195,7 @@ if (WIN32) set(TARGET_INSTALL_DIR ${NITPICK_INSTALL_DIR}) set(TARGET_INSTALL_COMPONENT ${CLIENT_COMPONENT}) + package_libraries_for_deployment() +elseif (APPLE) package_libraries_for_deployment() endif() From 53c5e966db9c19b15e24e709bee8ce19c86fb0d5 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 12:47:39 -0700 Subject: [PATCH 52/81] Debugging when to use macdeployqt. --- cmake/macros/FixupNitpick.cmake | 35 +++--- .../PackageLibrariesForDeployment.cmake | 118 ++++++++---------- 2 files changed, 65 insertions(+), 88 deletions(-) diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 97ad313000..6fcb9b3c7c 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -10,27 +10,22 @@ # macro(fixup_nitpick) - if (APPLE) - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) - set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + if (APPLE) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) + set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - if (NOT MACDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce a relocatable nitpick application.\ - Check that the variable QT_DIR points to your Qt installation.\ - ") + if (NOT MACDEPLOYQT_COMMAND) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce a relocatable nitpick application.\ + Check that the variable QT_DIR points to your Qt installation.\ + ") + endif () + + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + (COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + ) endif () - - install(CODE " - execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ - \${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/\ - -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ - )" - COMPONENT ${CLIENT_COMPONENT} - ) - - endif () endmacro() diff --git a/cmake/macros/PackageLibrariesForDeployment.cmake b/cmake/macros/PackageLibrariesForDeployment.cmake index f6963f9d82..b3f725b2b0 100644 --- a/cmake/macros/PackageLibrariesForDeployment.cmake +++ b/cmake/macros/PackageLibrariesForDeployment.cmake @@ -10,77 +10,59 @@ # macro(PACKAGE_LIBRARIES_FOR_DEPLOYMENT) - if (WIN32) - configure_file( - ${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake - @ONLY - ) + if (WIN32) + configure_file( + ${HF_CMAKE_DIR}/templates/FixupBundlePostBuild.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake + @ONLY + ) - set(PLUGIN_PATH "plugins") + set(PLUGIN_PATH "plugins") - # add a post-build command to copy DLLs beside the executable - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} - -DBUNDLE_EXECUTABLE="$" - -DBUNDLE_PLUGIN_DIR="$/${PLUGIN_PATH}" - -P "${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake" - ) + # add a post-build command to copy DLLs beside the executable + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} + -DBUNDLE_EXECUTABLE="$" + -DBUNDLE_PLUGIN_DIR="$/${PLUGIN_PATH}" + -P "${CMAKE_CURRENT_BINARY_DIR}/FixupBundlePostBuild.cmake" + ) - find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH) + find_program(WINDEPLOYQT_COMMAND windeployqt PATHS ${QT_DIR}/bin NO_DEFAULT_PATH) - if (NOT WINDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.") - endif () - - # add a post-build command to call windeployqt to copy Qt plugins - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ - ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ - --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" - ) - - set(QTAUDIO_PATH "$/audio") - set(QTAUDIO_WIN7_PATH "$/audioWin7/audio") - set(QTAUDIO_WIN8_PATH "$/audioWin8/audio") - - # copy qtaudio_wasapi.dll and qtaudio_windows.dll in the correct directories for runtime selection - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN7_PATH}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN8_PATH}" - # copy release DLLs - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windows.dll" "${QTAUDIO_WIN7_PATH}" ) - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapi.dll" "${QTAUDIO_WIN8_PATH}" ) - # copy debug DLLs - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windowsd.dll" "${QTAUDIO_WIN7_PATH}" ) - COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapid.dll" "${QTAUDIO_WIN8_PATH}" ) - # remove directory - COMMAND ${CMAKE_COMMAND} -E remove_directory "${QTAUDIO_PATH}" - ) - elseif (APPLE) - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - - if (NOT MACDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin. macdeployqt is required.") - endif () - - # add a post-build command to call macdeployqt to copy Qt plugins - add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - (COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ - ) - - add_custom_command( - TARGET ${TARGET_NAME} - POST_BUILD - COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ - ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ - --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" - ) + if (NOT WINDEPLOYQT_COMMAND) + message(FATAL_ERROR "Could not find windeployqt at ${QT_DIR}/bin. windeployqt is required.") endif () + + # add a post-build command to call windeployqt to copy Qt plugins + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND CMD /C "SET PATH=${QT_DIR}/bin;%PATH% && ${WINDEPLOYQT_COMMAND}\ + ${EXTRA_DEPLOY_OPTIONS} $<$,$,$>:--release>\ + --no-compiler-runtime --no-opengl-sw --no-angle -no-system-d3d-compiler \"$\"" + ) + + set(QTAUDIO_PATH "$/audio") + set(QTAUDIO_WIN7_PATH "$/audioWin7/audio") + set(QTAUDIO_WIN8_PATH "$/audioWin8/audio") + + # copy qtaudio_wasapi.dll and qtaudio_windows.dll in the correct directories for runtime selection + add_custom_command( + TARGET ${TARGET_NAME} + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN7_PATH}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${QTAUDIO_WIN8_PATH}" + # copy release DLLs + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windows.dll" "${QTAUDIO_WIN7_PATH}" ) + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windows.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapi.dll" "${QTAUDIO_WIN8_PATH}" ) + # copy debug DLLs + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${QTAUDIO_PATH}/qtaudio_windowsd.dll" "${QTAUDIO_WIN7_PATH}" ) + COMMAND if exist "${QTAUDIO_PATH}/qtaudio_windowsd.dll" ( ${CMAKE_COMMAND} -E copy "${WASAPI_DLL_PATH}/qtaudio_wasapid.dll" "${QTAUDIO_WIN8_PATH}" ) + # remove directory + COMMAND ${CMAKE_COMMAND} -E remove_directory "${QTAUDIO_PATH}" + ) + + endif () endmacro() From d1a29daf36783a49f9f4fec9821f2694149b96e6 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 12:56:49 -0700 Subject: [PATCH 53/81] Corrected both installers. --- cmake/macros/FixupNitpick.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 6fcb9b3c7c..3c7d89e833 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -25,7 +25,7 @@ macro(fixup_nitpick) endif () add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - (COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ ) endif () endmacro() From f2678ddb73bca06a6570b27559e3234cc96df270 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 12:57:08 -0700 Subject: [PATCH 54/81] Corrected both installers. --- cmake/macros/FixupInterface.cmake | 34 +++++++++++++------------------ cmake/macros/FixupNitpick.cmake | 2 +- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index d08ad2ac41..fd3918964a 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -10,28 +10,22 @@ # macro(fixup_interface) - if (APPLE) + if (APPLE) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) + set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) - set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + if (NOT MACDEPLOYQT_COMMAND) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce a relocatable interface application.\ + Check that the variable QT_DIR points to your Qt installation.\ + ") + endif () - if (NOT MACDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce an relocatable interface application.\ - Check that the variable QT_DIR points to your Qt installation.\ - ") + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + ) endif () - - install(CODE " - execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ - \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ - -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ - )" - COMPONENT ${CLIENT_COMPONENT} - ) - - endif () endmacro() diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 3c7d89e833..4ca6c01869 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -25,7 +25,7 @@ macro(fixup_nitpick) endif () add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ ) endif () endmacro() From c12d270f8a2edb4175b3e20f0ca8b5001037e6af Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Mon, 29 Apr 2019 14:33:17 -0700 Subject: [PATCH 55/81] Use macdeployqt in post build --- cmake/macros/FixupInterface.cmake | 2 +- cmake/macros/FixupNitpick.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index fd3918964a..a2959a73e3 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -25,7 +25,7 @@ macro(fixup_interface) endif () add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ ) endif () endmacro() diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 4ca6c01869..231e1bfec9 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -25,7 +25,7 @@ macro(fixup_nitpick) endif () add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MACDEPLOYQT_COMMAND}\${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/ -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ ) endif () endmacro() From 676f762348dd47f05c8490f24891ed0ebc13a311 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Tue, 30 Apr 2019 08:32:25 -0700 Subject: [PATCH 56/81] Updating readme's. --- BUILD.md | 31 +++++---- BUILD_LINUX.md | 178 ++++++++++++++++++++----------------------------- BUILD_OSX.md | 5 +- BUILD_WIN.md | 32 ++++----- 4 files changed, 103 insertions(+), 143 deletions(-) diff --git a/BUILD.md b/BUILD.md index 435ca74619..bd264a74ad 100644 --- a/BUILD.md +++ b/BUILD.md @@ -6,26 +6,25 @@ * [BUILD_ANDROID.md](BUILD_ANDROID.md) - additional instructions for Android ### Dependencies - +- [git](https://git-scm.com/downloads): >= 1.6 - [cmake](https://cmake.org/download/): 3.9 -- [Qt](https://www.qt.io/download-open-source): 5.12.3 - [Python](https://www.python.org/downloads/): 3.6 or higher ### CMake External Project Dependencies These dependencies need not be installed manually. They are automatically downloaded on the platforms where they are required. -- [Bullet Physics Engine](https://github.com/bulletphysics/bullet3/releases): 2.83 -- [glm](https://glm.g-truc.net/0.9.8/index.html): 0.9.8 -- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Win32) / 0.5 (Mac) -- [OpenVR](https://github.com/ValveSoftware/openvr): 1.0.6 (Win32 only) -- [Polyvox](http://www.volumesoffun.com/): 0.2.1 -- [QuaZip](https://sourceforge.net/projects/quazip/files/quazip/): 0.7.3 -- [SDL2](https://www.libsdl.org/download-2.0.php): 2.0.3 -- [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/): 4.3 -- [vcpkg](https://github.com/highfidelity/vcpkg): -- [VHACD](https://github.com/virneo/v-hacd) -- [zlib](http://www.zlib.net/): 1.28 (Win32 only) -- [nvtt](https://github.com/highfidelity/nvidia-texture-tools): 2.1.1 (customized) +- [Bullet Physics Engine](https://github.com/bulletphysics/bullet3/releases): 2.83 +- [glm](https://glm.g-truc.net/0.9.8/index.html): 0.9.8 +- [Oculus SDK](https://developer.oculus.com/downloads/): 1.11 (Win32) / 0.5 (Mac) +- [OpenVR](https://github.com/ValveSoftware/openvr): 1.0.6 (Win32 only) +- [Polyvox](http://www.volumesoffun.com/): 0.2.1 +- [QuaZip](https://sourceforge.net/projects/quazip/files/quazip/): 0.7.3 +- [SDL2](https://www.libsdl.org/download-2.0.php): 2.0.3 +- [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/): 4.3 +- [vcpkg](https://github.com/highfidelity/vcpkg): +- [VHACD](https://github.com/virneo/v-hacd) +- [zlib](http://www.zlib.net/): 1.28 (Win32 only) +- [nvtt](https://github.com/highfidelity/nvidia-texture-tools): 2.1.1 (customized) The above dependencies will be downloaded, built, linked and included automatically by CMake where we require them. The CMakeLists files that handle grabbing each of the following external dependencies can be found in the [cmake/externals folder](cmake/externals). The resulting downloads, source files and binaries will be placed in the `build/ext` folder in each of the subfolders for each external project. @@ -38,7 +37,7 @@ Hifi uses CMake to generate build files and project files for your platform. #### Qt CMake will download Qt 5.12.3 using vcpkg. -To override this (i.e. use an installed Qt configuration - you will need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt **lib/cmake** folder. +To override this (i.e. use an installed Qt configuration - you will need to set a QT_CMAKE_PREFIX_PATH environment variable pointing to your Qt **lib/cmake** folder. This can either be entered directly into your shell session before you build or in your shell profile (e.g.: ~/.bash_profile, ~/.bashrc, ~/.zshrc - this depends on your shell and environment). The path it needs to be set to will depend on where and how Qt5 was installed. e.g. export QT_CMAKE_PREFIX_PATH=/usr/local/Qt5.12.3/gcc_64/lib/cmake @@ -74,7 +73,7 @@ Any variables that need to be set for CMake to find dependencies can be set as E For example, to pass the QT_CMAKE_PREFIX_PATH variable (if not using the vcpkg'ed version) during build file generation: - cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.10.1/lib/cmake + cmake .. -DQT_CMAKE_PREFIX_PATH=/usr/local/qt/5.12.3/lib/cmake #### Finding Dependencies diff --git a/BUILD_LINUX.md b/BUILD_LINUX.md index 6b274b7f5b..e8599ffce4 100644 --- a/BUILD_LINUX.md +++ b/BUILD_LINUX.md @@ -1,7 +1,6 @@ # Linux build guide Please read the [general build guide](BUILD.md) for information on dependencies required for all platforms. Only Linux specific instructions are found in this file. - ## Qt5 Dependencies Should you choose not to install Qt5 via a package manager that handles dependencies for you, you may be missing some Qt5 dependencies. On Ubuntu, for example, the following additional packages are required: @@ -9,43 +8,43 @@ Should you choose not to install Qt5 via a package manager that handles dependen libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack0 libjack-dev libxrandr-dev libudev-dev libssl-dev zlib1g-dev ## Ubuntu 16.04/18.04 specific build guide - -### Ubuntu 18.04 only -Add the universe repository: -_(This is not enabled by default on the server edition)_ -```bash -sudo add-apt-repository universe -sudo apt-get update -``` - -### Prepare environment +### Ubuntu 16.04 only Add the following line to *.bash_profile* `export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/` +### Ubuntu 18.04 only +Add the universe repository: +_(This is not enabled by default on the server edition)_ +`sudo add-apt-repository universe` +`sudo apt-get update` #### Install build dependencies: -```bash -sudo apt-get install libasound2 libxmu-dev libxi-dev freeglut3-dev libasound2-dev libjack0 libjack-dev libxrandr-dev libudev-dev libssl-dev zlib1g-dev -``` - +1. OpenSSL +`sudo apt-get install libssl-dev` +Verify with `openssl version` +1. OpenGL +Verify (first install mesa-utils - `sudo apt install mesa-utils -y`) by `glxinfo | grep "OpenGL version"` +`sudo apt-get install libgl1-mesa-dev -y` +`sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.346.35 /usr/lib/x86_64-linux-gnu/libGL.so.1.2.0` #### To compile interface in a server you must install: -```bash -sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1 -``` - +`sudo apt-get -y install libpulse0 libnss3 libnspr4 libfontconfig1 libxcursor1 libxcomposite1 libxtst6 libxslt1.1` #### Install build tools: -```bash -# For Ubuntu 18.04 -sudo apt-get install cmake -``` -```bash -# For Ubuntu 16.04 -wget https://cmake.org/files/v3.9/cmake-3.9.5-Linux-x86_64.sh -sudo sh cmake-3.9.5-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir -``` - -#### Install Python 3: -```bash -sudo apt-get install python3 -``` +1. First update the repositiories: +`sudo apt-get update -y` +`sudo apt-get upgrade -y` +1. git +`sudo apt-get install git -y` +Verify by git --version +1. g++ +`sudo apt-get install g++ -y` +Verify by g++ --version +1. cmake +`sudo apt-get install cmake -y` +Verify by git --version +1. cmake +`wget https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.sh` +`sudo sh cmake-3.14.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir` +##### Python +Add to _bash_profile: +` ### Get code and checkout the tag you need Clone this repository: ```bash @@ -53,110 +52,75 @@ git clone https://github.com/highfidelity/hifi.git ``` To compile a RELEASE version checkout the tag you need getting a list of all tags: -```bash -git fetch -a -git tags -``` - +`git fetch -a` +`git tags` Then checkout last tag with: -```bash -git checkout tags/v0.79.0 -``` - +`git checkout tags/v0.79.0` ### Compiling Create the build directory: -```bash -mkdir -p hifi/build -cd hifi/build -``` - +`mkdir -p hifi/build` +`cd hifi/build` Prepare makefiles: -```bash -cmake .. -``` +`cmake ..` + +* If cmake fails with a vcpkg error - delete /tmp/hifi/vcpkg. Start compilation of the server and get a cup of coffee: -```bash -make domain-server assignment-client -``` - -To compile interface: -```bash -make interface -``` +`make domain-server assignment-client` +To compile interface: +`make interface` In a server, it does not make sense to compile interface - ### Running the software #### Domain server Running domain server: -```bash -./domain-server/domain-server -``` - +`./domain-server/domain-server` #### Assignment clients Running assignment client: -```bash -./assignment-client/assignment-client -n 6 -``` - +`./assignment-client/assignment-client -n 6` #### Interface Running interface: -```bash -./interface/interface -``` +`./interface/interface` -Go to localhost in the running interface. +Go to localhost in the running interface. ##### Ubuntu 18.04 only In Ubuntu 18.04 there is a problem related with NVidia driver library version. -It can be workarounded following these steps: +It can be worked around following these steps: -Uninstall incompatible nvtt libraries: -```bash -sudo apt-get remove libnvtt2 libnvtt-dev -``` +1. Uninstall incompatible nvtt libraries: +`sudo apt-get remove libnvtt2 libnvtt-dev` -Install libssl1.0-dev: -```bash -sudo apt-get -y install libssl1.0-dev -``` +1. Install libssl1.0-dev: +`sudo apt-get -y install libssl1.0-dev` -Clone castano nvidia-texture-tools: -``` -git clone https://github.com/castano/nvidia-texture-tools -cd nvidia-texture-tools/ -``` +1. Clone castano nvidia-texture-tools: +`git clone https://github.com/castano/nvidia-texture-tools` +`cd nvidia-texture-tools/` -Make these changes in repo: -* In file **VERSION** set `2.2.1` -* In file **configure**: - * set `build="release"` - * set `-DNVTT_SHARED=1` +1. Make these changes in repo: +* In file **VERSION** set `2.2.1` +* In file **configure**: + * set `build="release"` + * set `-DNVTT_SHARED=1` -Configure, build and install: -``` -./configure -make -sudo make install -``` +1. Configure, build and install: +`./configure` +`make` +`sudo make install` -Link compiled files: -``` -sudo ln -s /usr/local/lib/libnvcore.so /usr/lib/libnvcore.so -sudo ln -s /usr/local/lib/libnvimage.so /usr/lib/libnvimage.so -sudo ln -s /usr/local/lib/libnvmath.so /usr/lib/libnvmath.so -sudo ln -s /usr/local/lib/libnvtt.so /usr/lib/libnvtt.so -``` +1.. Link compiled files: +`sudo ln -s /usr/local/lib/libnvcore.so /usr/lib/libnvcore.so` +`sudo ln -s /usr/local/lib/libnvimage.so /usr/lib/libnvimage.so` +`sudo ln -s /usr/local/lib/libnvmath.so /usr/lib/libnvmath.so` +`sudo ln -s /usr/local/lib/libnvtt.so /usr/lib/libnvtt.so` -After running this steps you can run interface: -``` -interface/interface -``` +`. After running this steps you can run interface: +`interface/interface` diff --git a/BUILD_OSX.md b/BUILD_OSX.md index 181ae29022..875d49bcb8 100644 --- a/BUILD_OSX.md +++ b/BUILD_OSX.md @@ -8,11 +8,12 @@ Please read the [general build guide](BUILD.md) for information on dependencies ### Python 3 -Download an install Python 3.6.6 or higher from [here](https://www.python.org/downloads/). Execute the `Update Shell Profile.command` script that is provided with the installer. +Download an install Python 3.6.6 or higher from [here](https://www.python.org/downloads/). +Execute the `Update Shell Profile.command` script that is provided with the installer. ### OpenSSL -Assuming you've installed OpenSSL using the homebrew instructions above, you'll need to set OPENSSL_ROOT_DIR so CMake can find your installations. +Assuming you've installed OpenSSL using the homebrew instructions above, you'll need to set OPENSSL_ROOT_DIR so CMake can find your installations. For OpenSSL installed via homebrew, set OPENSSL_ROOT_DIR: export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2l diff --git a/BUILD_WIN.md b/BUILD_WIN.md index c9938fd3f3..20ece131f4 100644 --- a/BUILD_WIN.md +++ b/BUILD_WIN.md @@ -1,6 +1,7 @@ This is a stand-alone guide for creating your first High Fidelity build for Windows 64-bit. ## Building High Fidelity -Note: We are now using Visual Studio 2017 and Qt 5.10.1. If you are upgrading from Visual Studio 2013 and Qt 5.6.2, do a clean uninstall of those versions before going through this guide. +Note: We are now using Visual Studio 2017 and Qt 5.12.3. +If you are upgrading from previous versions, do a clean uninstall of those versions before going through this guide. Note: The prerequisites will require about 10 GB of space on your drive. You will also need a system with at least 8GB of main memory. @@ -8,7 +9,8 @@ Note: The prerequisites will require about 10 GB of space on your drive. You wil If you don’t have Community or Professional edition of Visual Studio 2017, download [Visual Studio Community 2017](https://www.visualstudio.com/downloads/). -When selecting components, check "Desktop development with C++". Also on the right on the Summary toolbar, check "Windows 8.1 SDK and UCRT SDK" and "VC++ 2015.3 v140 toolset (x86,x64)". If you do not already have a python development environment installed, also check "Python Development" in this screen. +Leave default components. +If you do not already have a python development environment installed, also check "Python Development" in this screen. If you already have Visual Studio installed and need to add python, open the "Add or remove programs" control panel and find the "Microsoft Visual Studio Installer". Select it and click "Modify". In the installer, select "Modify" again, then check "Python Development" and allow the installer to apply the changes. @@ -23,13 +25,11 @@ Download and install the latest version of CMake 3.9. Download the file named win64-x64 Installer from the [CMake Website](https://cmake.org/download/). You can access the installer on this [3.9 Version page](https://cmake.org/files/v3.9/). During installation, make sure to check "Add CMake to system PATH for all users" when prompted. ### Step 5. Running CMake to Generate Build Files -Run Command Prompt from Start and run the following commands: -``` -cd "%HIFI_DIR%" -mkdir build -cd build -cmake .. -G "Visual Studio 15 Win64" -``` +Run Command Prompt from Start and run the following commands: +`cd "%HIFI_DIR%"` +`mkdir build` +`cd build` +`cmake .. -G "Visual Studio 15 Win64"` Where `%HIFI_DIR%` is the directory for the highfidelity repository. @@ -55,11 +55,11 @@ Note: You can also run Interface by launching it from command line or File Explo ## Troubleshooting -For any problems after Step #7, first try this: -* Delete your locally cloned copy of the highfidelity repository -* Restart your computer -* Redownload the [repository](https://github.com/highfidelity/hifi) -* Restart directions from Step #7 +For any problems after Step #7, first try this: +* Delete your locally cloned copy of the highfidelity repository +* Restart your computer +* Redownload the [repository](https://github.com/highfidelity/hifi) +* Restart directions from Step #7 #### CMake gives you the same error message repeatedly after the build fails @@ -68,7 +68,3 @@ Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. #### CMake can't find OpenSSL Remove `CMakeCache.txt` found in the `%HIFI_DIR%\build` directory. Verify that your HIFI_VCPKG_BASE environment variable is set and pointing to the correct location. Verify that the file `${HIFI_VCPKG_BASE}/installed/x64-windows/include/openssl/ssl.h` exists. - -#### Qt is throwing an error - -Make sure you have the correct version (5.10.1) installed and `QT_CMAKE_PREFIX_PATH` environment variable is set correctly. From 80bf1e592dee7f7cd0ad1cdc07d22222e256aa3b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 3 May 2019 20:37:40 -0700 Subject: [PATCH 57/81] Allow build on both Ubuntu 16.04 (Jenkins) and 18.04 --- hifi_vcpkg.py | 24 ++++++++++++++++-------- tools/qt-builder/README.md | 19 +++++++++++++++---- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index e1d509b9df..6d64a76f73 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -241,17 +241,25 @@ endif() def installQt(self): if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): - print ("Downloading Qt from AWS ") + 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.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.tar.gz" + url = 'https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.tar.gz' elif platform.system() == 'Linux': - url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/qt5-install.tar.gz" - - print("Extracting " + url + " to " + dest) + if (platform.linux_distribution()[1] == '16.04': + self.vcpkgUrl = 'https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04/qt5-install.tar.gz' + elif platform.linux_distribution()[1] == '18.04': + self.vcpkgUrl = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04/qt5-install.tar.gz" + else: + print('UNKNOWN LINUX VERSION!!!') + else: + print('UNKNOWN OPERATING SYSTEM!!!') + + print('Extracting ' + url + ' to ' + dest) + hifi_utils.downloadAndExtract(url, dest) else: - print ("Qt has already been downloaded") - + print ('Qt has already been downloaded') diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index b23a691e3a..8c59b8578f 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -96,6 +96,8 @@ Verify again `sudo apt-get install libdbus-glib-1-dev -y` 1. nss (needed for qtwebengine) `sudo apt-get install libnss3-dev -y` +1. Add the following line to *.bash_profile* (otherwise fonts will not be displayed) +`export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/` ### Mac 1. git >= 1.6 Check if needed `git --version` @@ -112,7 +114,7 @@ The build is performed in the qt5-build folder. Build products are installed to the qt5-install folder. Before running configure, make sure that the qt5-build folder is empty. -**Only run the patches once!!!** +**Only run the git patches once!!!** ### Windows Before building, verify that **HIFI_VCPKG_BASE_VERSION** points to a *vcpkg* folder containing *packages\openssl-windows_x64-windows*. If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then *openssl*. @@ -164,8 +166,12 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `mkdir qt5-build` `cd qt5-build` +*Ubuntu 16.04* `../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` -#### Make + +*Ubuntu 18.04* +`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +#### Make `make` `make install` #### Fixing @@ -185,8 +191,13 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `filename.add("qt5-install", os.path.basename("qt5-install"))` `exit()` -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/ -### Mac +*Ubuntu 16.04* +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04 + +*Ubuntu 16.04* +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04 + +1. ### Mac #### Preparing source files git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch From cec0cd658b1c5b2ce4cc8a65197264d99fc267b2 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 3 May 2019 20:42:49 -0700 Subject: [PATCH 58/81] Typo. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 6d64a76f73..39e4a3a788 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -249,7 +249,7 @@ endif() elif platform.system() == 'Darwin': url = 'https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.tar.gz' elif platform.system() == 'Linux': - if (platform.linux_distribution()[1] == '16.04': + if platform.linux_distribution()[1] == '16.04': self.vcpkgUrl = 'https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04/qt5-install.tar.gz' elif platform.linux_distribution()[1] == '18.04': self.vcpkgUrl = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04/qt5-install.tar.gz" From b7f8e7802d56f181fd808cff626065269c1eaf19 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 3 May 2019 21:10:19 -0700 Subject: [PATCH 59/81] Error in variable name. --- hifi_vcpkg.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 39e4a3a788..fb7e13a0c2 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -244,22 +244,22 @@ endif() print ('Downloading Qt from AWS') dest = os.path.join(self.path, 'installed') + url = 'NOT DEFINED' if platform.system() == 'Windows': 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.tar.gz' elif platform.system() == 'Linux': if platform.linux_distribution()[1] == '16.04': - self.vcpkgUrl = 'https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04/qt5-install.tar.gz' + url = 'https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04/qt5-install.tar.gz' elif platform.linux_distribution()[1] == '18.04': - self.vcpkgUrl = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04/qt5-install.tar.gz" + url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04/qt5-install.tar.gz" else: print('UNKNOWN LINUX VERSION!!!') else: print('UNKNOWN OPERATING SYSTEM!!!') print('Extracting ' + url + ' to ' + dest) - hifi_utils.downloadAndExtract(url, dest) else: print ('Qt has already been downloaded') From ec4a3fed4381c9d8429b1e700f0e2b2ca05b64e4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Fri, 3 May 2019 21:20:18 -0700 Subject: [PATCH 60/81] Using Andrew's configure line. --- tools/qt-builder/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 8c59b8578f..2b6ecda8ac 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -170,7 +170,8 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ `../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -no-egl -no-icu -prefix ../qt5-install` *Ubuntu 18.04* -`../qt5/configure -opensource -confirm-license -platform linux-g++-64 -qt-zlib -qt-libjpeg -qt-libpng -qt-xcb -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -force-debug-info -release -opensource -confirm-license -gdb-index -recheck-all -nomake tests -nomake examples -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -c++std c++14 -prefix ../qt5-install` + #### Make `make` `make install` From c9e372aa53d3c615297c9d334a64fe183395449b Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 4 May 2019 17:30:10 -0700 Subject: [PATCH 61/81] Updated for Ubuntu 16.04/18.04 --- tools/qt-builder/README.md | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index 2b6ecda8ac..c8823c89c5 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -96,8 +96,6 @@ Verify again `sudo apt-get install libdbus-glib-1-dev -y` 1. nss (needed for qtwebengine) `sudo apt-get install libnss3-dev -y` -1. Add the following line to *.bash_profile* (otherwise fonts will not be displayed) -`export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/` ### Mac 1. git >= 1.6 Check if needed `git --version` @@ -174,33 +172,39 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ #### Make `make` + +*Ubuntu 18.04 only* +`make module-qtwebengine` +`make module-qtscript` + +*Both* `make install` #### Fixing 1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) `cd ../qt5-install` `find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` 1. Copy *qt.conf* to *qt5-install\bin* -#### Uploading -1. Return to the home folder +#### Uploading +*Ubuntu 16.04* +1. Return to the home folder `cd ..` 1. Open a python 3 shell `python3` 1. Run the following snippet: `import os` `import tarfile` -`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` -`filename.add("qt5-install", os.path.basename("qt5-install"))` +`filename=tarfile.open("qt5-install.tar.gz", "w:gz")` +`filename.add("qt5-install", os.path.basename("qt5-install"))` `exit()` +1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04 -*Ubuntu 16.04* -1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04 - -*Ubuntu 16.04* +*Ubuntu 18.04* +``tar -zcvf qt5-install.tar.gz qt5-install` 1. Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04 -1. ### Mac -#### Preparing source files -git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch +1. ### Mac +#### Preparing source files +git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch * Copy the **patches** folder to qt5 * Apply one patch to Qt From 50d1958c4c79c4631b9a1e2d1cf187b545b531c9 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 4 May 2019 17:30:49 -0700 Subject: [PATCH 62/81] Reverted unneeded changes. --- cmake/macros/FixupInterface.cmake | 34 +++++++++++++++++------------- cmake/macros/FixupNitpick.cmake | 35 ++++++++++++++++++------------- 2 files changed, 40 insertions(+), 29 deletions(-) diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index a2959a73e3..93b5cc25fb 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -10,22 +10,28 @@ # macro(fixup_interface) - if (APPLE) - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) - set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + if (APPLE) - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) + set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - if (NOT MACDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce a relocatable interface application.\ - Check that the variable QT_DIR points to your Qt installation.\ - ") - endif () + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ - ) + if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce an relocatable interface application.\ + Check that the environment variable QT_DIR points to your Qt installation.\ + ") endif () + + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ + \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ + -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ + )" + COMPONENT ${CLIENT_COMPONENT} + ) + + endif () endmacro() diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 231e1bfec9..8477b17823 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -10,22 +10,27 @@ # macro(fixup_nitpick) - if (APPLE) - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) - set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + if (APPLE) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) + set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - if (NOT MACDEPLOYQT_COMMAND) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce a relocatable nitpick application.\ - Check that the variable QT_DIR points to your Qt installation.\ - ") - endif () - - add_custom_command(TARGET ${TARGET_NAME} POST_BUILD - COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ - ) + if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce a relocatable nitpick application.\ + Check that the environment variable QT_DIR points to your Qt installation.\ + ") endif () + + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ + \${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/\ + -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ + )" + COMPONENT ${CLIENT_COMPONENT} + ) + + endif () endmacro() From 844fbec36fe830be36e96d8d64f3fa1a289c151f Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 4 May 2019 18:09:54 -0700 Subject: [PATCH 63/81] So that both Jenkins and local Mac are happy. --- cmake/macros/FixupInterface.cmake | 44 ++++++++++++++++-------------- cmake/macros/FixupNitpick.cmake | 45 +++++++++++++++++-------------- tools/nitpick/src/Nitpick.cpp | 11 ++++---- tools/nitpick/src/Nitpick.h | 5 ++-- 4 files changed, 58 insertions(+), 47 deletions(-) diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index 93b5cc25fb..e1ade61c7a 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -10,28 +10,32 @@ # macro(fixup_interface) - if (APPLE) + if (APPLE) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) + set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${INTERFACE_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${INTERFACE_INSTALL_DIR}) - set(_INTERFACE_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce an relocatable interface application.\ + Check that the variable QT_DIR points to your Qt installation.\ + ") + endif () - if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce an relocatable interface application.\ - Check that the environment variable QT_DIR points to your Qt installation.\ - ") + if (DEV_BUILD) + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ + \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ + -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ + )" + COMPONENT ${CLIENT_COMPONENT} + ) + else () + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + ) + endif() endif () - - install(CODE " - execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ - \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ - -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ - )" - COMPONENT ${CLIENT_COMPONENT} - ) - - endif () endmacro() diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 8477b17823..0930019197 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -10,27 +10,32 @@ # macro(fixup_nitpick) - if (APPLE) - string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) - string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) - set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") + if (APPLE) + string(REPLACE " " "\\ " ESCAPED_BUNDLE_NAME ${NITPICK_BUNDLE_NAME}) + string(REPLACE " " "\\ " ESCAPED_INSTALL_PATH ${NITPICK_INSTALL_DIR}) + set(_NITPICK_INSTALL_PATH "${ESCAPED_INSTALL_PATH}/${ESCAPED_BUNDLE_NAME}.app") - find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) + find_program(MACDEPLOYQT_COMMAND macdeployqt PATHS "${QT_DIR}/bin" NO_DEFAULT_PATH) - if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) - message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ - It is required to produce a relocatable nitpick application.\ - Check that the environment variable QT_DIR points to your Qt installation.\ - ") + if (NOT MACDEPLOYQT_COMMAND AND (PRODUCTION_BUILD OR PR_BUILD)) + message(FATAL_ERROR "Could not find macdeployqt at ${QT_DIR}/bin.\ + It is required to produce a relocatable nitpick application.\ + Check that the variable QT_DIR points to your Qt installation.\ + ") + endif () + + if (DEV_BUILD) + install(CODE " + execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ + \${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/\ + -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ + )" + COMPONENT ${CLIENT_COMPONENT} + ) + else () + add_custom_command(TARGET ${TARGET_NAME} POST_BUILD + COMMAND ${MACDEPLOYQT_COMMAND} "$/../.." -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/ + ) + endif() endif () - - install(CODE " - execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ - \${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/\ - -verbose=2 -qmldir=${CMAKE_SOURCE_DIR}/interface/resources/qml/\ - )" - COMPONENT ${CLIENT_COMPONENT} - ) - - endif () endmacro() diff --git a/tools/nitpick/src/Nitpick.cpp b/tools/nitpick/src/Nitpick.cpp index 16cad8726c..3bed7cde65 100644 --- a/tools/nitpick/src/Nitpick.cpp +++ b/tools/nitpick/src/Nitpick.cpp @@ -192,14 +192,19 @@ void Nitpick::on_createTestsOutlinePushbutton_clicked() { _testCreator->createTestsOutline(); } +// TestRail interface void Nitpick::on_createTestRailTestCasesPushbutton_clicked() { _testCreator->createTestRailTestCases(); } -void Nitpick::on_createTestRailRunButton_clicked() { +void Nitpick::on_createTestRailRunPushButton_clicked() { _testCreator->createTestRailRun(); } +void Nitpick::on_updateTestRailRunResultsPushbutton_clicked() { + _testCreator->updateTestRailRunResult(); +} + void Nitpick::on_setWorkingFolderRunOnDesktopPushbutton_clicked() { _testRunnerDesktop->setWorkingFolderAndEnableControls(); } @@ -231,10 +236,6 @@ void Nitpick::automaticTestRunEvaluationComplete(QString zippedFolderName, int n _testRunnerDesktop->automaticTestRunEvaluationComplete(zippedFolderName, numberOfFailures); } -void Nitpick::on_updateTestRailRunResultsPushbutton_clicked() { - _testCreator->updateTestRailRunResult(); -} - // To toggle between show and hide // if (uState & ABS_AUTOHIDE) on_showTaskbarButton_clicked(); // else on_hideTaskbarButton_clicked(); diff --git a/tools/nitpick/src/Nitpick.h b/tools/nitpick/src/Nitpick.h index 9aa0ea00ba..d1f077a344 100644 --- a/tools/nitpick/src/Nitpick.h +++ b/tools/nitpick/src/Nitpick.h @@ -65,8 +65,10 @@ private slots: void on_createTestsOutlinePushbutton_clicked(); + // TestRail interface void on_createTestRailTestCasesPushbutton_clicked(); - void on_createTestRailRunButton_clicked(); + void on_createTestRailRunPushButton_clicked(); + void on_updateTestRailRunResultsPushbutton_clicked(); void on_setWorkingFolderRunOnDesktopPushbutton_clicked(); void on_runNowPushbutton_clicked(); @@ -75,7 +77,6 @@ private slots: void on_runLatestOnDesktopCheckBox_clicked(); void on_runFullSuiteOnDesktopCheckBox_clicked(); - void on_updateTestRailRunResultsPushbutton_clicked(); void on_hideTaskbarPushbutton_clicked(); void on_showTaskbarPushbutton_clicked(); From 6ff6c0c410e1a99cc4341417585fac854e02535e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 4 May 2019 18:45:27 -0700 Subject: [PATCH 64/81] Reverted erroneous commit. --- tools/nitpick/src/Nitpick.cpp | 11 +++++------ tools/nitpick/src/Nitpick.h | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/nitpick/src/Nitpick.cpp b/tools/nitpick/src/Nitpick.cpp index 3bed7cde65..16cad8726c 100644 --- a/tools/nitpick/src/Nitpick.cpp +++ b/tools/nitpick/src/Nitpick.cpp @@ -192,19 +192,14 @@ void Nitpick::on_createTestsOutlinePushbutton_clicked() { _testCreator->createTestsOutline(); } -// TestRail interface void Nitpick::on_createTestRailTestCasesPushbutton_clicked() { _testCreator->createTestRailTestCases(); } -void Nitpick::on_createTestRailRunPushButton_clicked() { +void Nitpick::on_createTestRailRunButton_clicked() { _testCreator->createTestRailRun(); } -void Nitpick::on_updateTestRailRunResultsPushbutton_clicked() { - _testCreator->updateTestRailRunResult(); -} - void Nitpick::on_setWorkingFolderRunOnDesktopPushbutton_clicked() { _testRunnerDesktop->setWorkingFolderAndEnableControls(); } @@ -236,6 +231,10 @@ void Nitpick::automaticTestRunEvaluationComplete(QString zippedFolderName, int n _testRunnerDesktop->automaticTestRunEvaluationComplete(zippedFolderName, numberOfFailures); } +void Nitpick::on_updateTestRailRunResultsPushbutton_clicked() { + _testCreator->updateTestRailRunResult(); +} + // To toggle between show and hide // if (uState & ABS_AUTOHIDE) on_showTaskbarButton_clicked(); // else on_hideTaskbarButton_clicked(); diff --git a/tools/nitpick/src/Nitpick.h b/tools/nitpick/src/Nitpick.h index d1f077a344..9aa0ea00ba 100644 --- a/tools/nitpick/src/Nitpick.h +++ b/tools/nitpick/src/Nitpick.h @@ -65,10 +65,8 @@ private slots: void on_createTestsOutlinePushbutton_clicked(); - // TestRail interface void on_createTestRailTestCasesPushbutton_clicked(); - void on_createTestRailRunPushButton_clicked(); - void on_updateTestRailRunResultsPushbutton_clicked(); + void on_createTestRailRunButton_clicked(); void on_setWorkingFolderRunOnDesktopPushbutton_clicked(); void on_runNowPushbutton_clicked(); @@ -77,6 +75,7 @@ private slots: void on_runLatestOnDesktopCheckBox_clicked(); void on_runFullSuiteOnDesktopCheckBox_clicked(); + void on_updateTestRailRunResultsPushbutton_clicked(); void on_hideTaskbarPushbutton_clicked(); void on_showTaskbarPushbutton_clicked(); From c0201ac2ba702cec996ee2ed2ede191f208b4caa Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sat, 4 May 2019 18:45:51 -0700 Subject: [PATCH 65/81] Corrected cmake macros. --- cmake/macros/FixupInterface.cmake | 2 +- cmake/macros/FixupNitpick.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/macros/FixupInterface.cmake b/cmake/macros/FixupInterface.cmake index e1ade61c7a..0bfc1cb39c 100644 --- a/cmake/macros/FixupInterface.cmake +++ b/cmake/macros/FixupInterface.cmake @@ -24,7 +24,7 @@ macro(fixup_interface) ") endif () - if (DEV_BUILD) + if (RELEASE_TYPE STREQUAL "DEV") install(CODE " execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ \${CMAKE_INSTALL_PREFIX}/${_INTERFACE_INSTALL_PATH}/\ diff --git a/cmake/macros/FixupNitpick.cmake b/cmake/macros/FixupNitpick.cmake index 0930019197..db96fec724 100644 --- a/cmake/macros/FixupNitpick.cmake +++ b/cmake/macros/FixupNitpick.cmake @@ -24,7 +24,7 @@ macro(fixup_nitpick) ") endif () - if (DEV_BUILD) + if (RELEASE_TYPE STREQUAL "DEV") install(CODE " execute_process(COMMAND ${MACDEPLOYQT_COMMAND}\ \${CMAKE_INSTALL_PREFIX}/${_NITPICK_INSTALL_PATH}/\ From f1593cad709ff58c5797e9bc687fe789de454195 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 5 May 2019 17:16:38 -0700 Subject: [PATCH 66/81] Updated readmes. --- BUILD_LINUX.md | 13 ++++--------- tools/qt-builder/README.md | 13 ++++++++----- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/BUILD_LINUX.md b/BUILD_LINUX.md index e8599ffce4..0bfb99c4cf 100644 --- a/BUILD_LINUX.md +++ b/BUILD_LINUX.md @@ -11,7 +11,7 @@ Should you choose not to install Qt5 via a package manager that handles dependen ### Ubuntu 16.04 only Add the following line to *.bash_profile* `export QT_QPA_FONTDIR=/usr/share/fonts/truetype/dejavu/` -### Ubuntu 18.04 only +### Ubuntu 18.04 server only Add the universe repository: _(This is not enabled by default on the server edition)_ `sudo add-apt-repository universe` @@ -36,20 +36,15 @@ Verify by git --version 1. g++ `sudo apt-get install g++ -y` Verify by g++ --version -1. cmake +1. *Ubuntu 18.04* cmake `sudo apt-get install cmake -y` Verify by git --version -1. cmake +1. *Ubuntu 16.04* cmake `wget https://cmake.org/files/v3.14/cmake-3.14.2-Linux-x86_64.sh` `sudo sh cmake-3.14.2-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir` -##### Python -Add to _bash_profile: -` ### Get code and checkout the tag you need Clone this repository: -```bash -git clone https://github.com/highfidelity/hifi.git -``` +`git clone https://github.com/highfidelity/hifi.git` To compile a RELEASE version checkout the tag you need getting a list of all tags: `git fetch -a` diff --git a/tools/qt-builder/README.md b/tools/qt-builder/README.md index c8823c89c5..4cd49ce865 100644 --- a/tools/qt-builder/README.md +++ b/tools/qt-builder/README.md @@ -135,7 +135,7 @@ If not, follow https://github.com/highfidelity/vcpkg to install *vcpkg* and then run `..\qt5\qt5vars.bat` `cd ..\..\qt5-build` -`..\qt5\configure -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` +`..\qt5\configure -force-debug-info -opensource -confirm-license -opengl desktop -platform win32-msvc -openssl-linked OPENSSL_LIBS="-lssleay32 -llibeay32" -I %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\include -L %HIFI_VCPKG_BASE_VERSION%\packages\openssl-windows_x64-windows\lib -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ..\qt5-install` #### Make `nmake` `nmake install` @@ -170,12 +170,14 @@ Upload qt5-install.tar.gz to https://hifi-qa.s3.amazonaws.com/qt5/Windows/ *Ubuntu 18.04* `../qt5/configure -force-debug-info -release -opensource -confirm-license -gdb-index -recheck-all -nomake tests -nomake examples -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -c++std c++14 -prefix ../qt5-install` + +???`../qt5/configure -opensource -confirm-license -gdb-index -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` -*Ubuntu 18.04 only* -`make module-qtwebengine` -`make module-qtscript` +????*Ubuntu 18.04 only* +????`make module-qtwebengine` +????`make module-qtscript` *Both* `make install` @@ -216,7 +218,7 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch `mkdir qt5-build` `cd ../qt5-build` -`../qt5/configure -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` +`../qt5/configure -force-debug-info -opensource -confirm-license -qt-zlib -qt-libjpeg -qt-libpng -qt-freetype -qt-pcre -qt-harfbuzz -nomake examples -nomake tests -skip qttranslations -skip qtserialport -skip qt3d -skip qtlocation -skip qtwayland -skip qtsensors -skip qtgamepad -skip qtspeech -skip qtcharts -skip qtx11extras -skip qtmacextras -skip qtvirtualkeyboard -skip qtpurchasing -skip qtdatavis3d -no-warnings-are-errors -no-pch -prefix ../qt5-install` #### Make `make` `make install` @@ -224,6 +226,7 @@ git clone --recursive git://code.qt.io/qt/qt5.git -b 5.12.3 --single-branch 1. The *.prl* files have an absolute path that needs to be removed (see http://www.linuxfromscratch.org/blfs/view/stable-systemd/x/qtwebengine.html) `cd ../qt5-install` `find . -name \*.prl -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;` +`cd ..` 1. Copy *qt.conf* to *qt5-install\bin* #### Uploading `tar -zcvf qt5-install.tar.gz qt5-install` From 6445d6d03194c0dbcc284a5828c3668510fc8df7 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 5 May 2019 17:42:06 -0700 Subject: [PATCH 67/81] For testing. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index fb7e13a0c2..b32279cbe7 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): print ('Downloading Qt from AWS') dest = os.path.join(self.path, 'installed') From 71f1d870388f017a5eeda00c6f95a0bc12204f16 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Sun, 5 May 2019 22:51:57 -0700 Subject: [PATCH 68/81] Removed test code. --- hifi_vcpkg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index b32279cbe7..fb7e13a0c2 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -240,7 +240,7 @@ endif() def installQt(self): - if True or not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + 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') From 2d21b5c2699b93ea6355ea5f6bc8fbf4e59d2041 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 13 May 2019 14:26:16 -0700 Subject: [PATCH 69/81] use qt.conf file to find Qt resources --- interface/CMakeLists.txt | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index bb8ebbd2a0..7bf6bc1a86 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -333,11 +333,11 @@ if (APPLE) COMMAND "${CMAKE_COMMAND}" -E copy_directory "${PROJECT_SOURCE_DIR}/resources/fonts" "${RESOURCES_DEV_DIR}/fonts" - #copy serverless for android - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${PROJECT_SOURCE_DIR}/resources/serverless" - "${RESOURCES_DEV_DIR}/serverless" - # add redirect json to macOS builds. + #copy serverless for android + COMMAND "${CMAKE_COMMAND}" -E copy_directory + "${PROJECT_SOURCE_DIR}/resources/serverless" + "${RESOURCES_DEV_DIR}/serverless" + # add redirect json to macOS builds. COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json" @@ -400,6 +400,29 @@ else() endif() endif() +if (APPLE OR UNIX) + # need to worry about hard-coded search paths in the Qt libraries + set(QT_LIB_PATH "${VCPKG_INSTALL_ROOT}/../qt5-install") + if (APPLE) + set(QT_CONF_OVERRIDE "${RESOURCES_DEV_DIR}/../qt.conf") + else () + set(QT_CONF_OVERRIDE "${INTERFACE_EXEC_DIR}/qt.conf") + endif () + if (DEFINED ENV{QT_CMAKE_PREFIX_PATH}) + # using VCPKG-installed Qt rather than a custom install + # TODO: erase old qt.conf file if it exists + # HINT: the file(REMOVE) operation below does not succeed + #file(REMOVE ${QT_CONF_OVERRIDE}) + else () + # using VCPKG-installed Qt rather than a custom install + # need to create qt.conf file to override hard coded + file(GENERATE + OUTPUT "${QT_CONF_OVERRIDE}" + CONTENT "[Paths]\nPrefix=${QT_LIB_PATH}\n" + ) + endif() +endif() + if (SCRIPTS_INSTALL_DIR) # setup install of scripts beside interface executable install( From 5a27f15821bc4e1668d76deba7ecf91f9e2a814f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 15 May 2019 09:33:43 -0700 Subject: [PATCH 70/81] new qt5 assets in a more correct aws bucket --- hifi_vcpkg.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index fb7e13a0c2..576b200ea4 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -245,21 +245,31 @@ endif() dest = os.path.join(self.path, 'installed') url = 'NOT DEFINED' + sha512sum = None if platform.system() == 'Windows': - url = 'https://hifi-qa.s3.amazonaws.com/qt5/Windows/qt5-install.tar.gz' + # TODO: figure out how to download with versionId + #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz?versionId=Etx8novAe0.IxQ7AosLFtop7fZur.cx9' + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz' + sha512sum = 'c0d1416d28ff8f4570651cf7d18857709f573567d34ac66f62a368983b8643dde20806b8c1de19886cd60b5586d98aa49f109b15a842def82ab3c4f76419d99e' elif platform.system() == 'Darwin': - url = 'https://hifi-qa.s3.amazonaws.com/qt5/Mac/qt5-install.tar.gz' + #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz?versionId=QrGxwssB.WwU_z3QCyG7ghP1_VjTkQeK' + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz' + sha512sum = '025a1aa258f6ca41c9544e1ab871b7af5fde891fc2be2cbfca3ba6c89f40c7cf5794997f5e78e83dc20fa0aaeab7223f2c82923df1ce698bdc87fe4f2aebf23f' elif platform.system() == 'Linux': if platform.linux_distribution()[1] == '16.04': - url = 'https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/16.04/qt5-install.tar.gz' + #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz?versionId=c9j7PW4uBDPLif7DKmgIhorh9WBMjZRB' + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz' + sha512sum = '290fdf0ac1bbc54791650bcff971dc69502bbacbcc88f69a9f439d23a5ca5c114a2d7d8bd354c29abfd48e20d0757aaf1eac3d12bac8b207d9ab6ad24b5f30b8' elif platform.linux_distribution()[1] == '18.04': - url = "https://hifi-qa.s3.amazonaws.com/qt5/Ubuntu/18.04/qt5-install.tar.gz" + #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz?versionId=Z3TojPFdb5pXdahF3oi85jjKocpL0xqw' + url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' + sha512sum = '74bcce1879251ec5e78b82d9b99a73a5b94698a4937ba91d6abf0047daee08d21cab364be6cbda8bb97e1f4cfa35c931bd42265032bff468d0ecbc0b8f5fab77' else: print('UNKNOWN LINUX VERSION!!!') else: print('UNKNOWN OPERATING SYSTEM!!!') print('Extracting ' + url + ' to ' + dest) - hifi_utils.downloadAndExtract(url, dest) + hifi_utils.downloadAndExtract(url, dest, sha512sum) else: print ('Qt has already been downloaded') From 9884d390b898650ebedc46583e0c164eef839b89 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 15 May 2019 09:34:08 -0700 Subject: [PATCH 71/81] fix qt.conf location for MacOS --- interface/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 7bf6bc1a86..133ef05136 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -404,20 +404,20 @@ if (APPLE OR UNIX) # need to worry about hard-coded search paths in the Qt libraries set(QT_LIB_PATH "${VCPKG_INSTALL_ROOT}/../qt5-install") if (APPLE) - set(QT_CONF_OVERRIDE "${RESOURCES_DEV_DIR}/../qt.conf") + set(QT_CONF_FILE "${RESOURCES_DEV_DIR}/../Resources/qt.conf") else () - set(QT_CONF_OVERRIDE "${INTERFACE_EXEC_DIR}/qt.conf") + set(QT_CONF_FILE "${INTERFACE_EXEC_DIR}/qt.conf") endif () if (DEFINED ENV{QT_CMAKE_PREFIX_PATH}) # using VCPKG-installed Qt rather than a custom install # TODO: erase old qt.conf file if it exists # HINT: the file(REMOVE) operation below does not succeed - #file(REMOVE ${QT_CONF_OVERRIDE}) + #file(REMOVE ${QT_CONF_FILE}) else () # using VCPKG-installed Qt rather than a custom install # need to create qt.conf file to override hard coded file(GENERATE - OUTPUT "${QT_CONF_OVERRIDE}" + OUTPUT "${QT_CONF_FILE}" CONTENT "[Paths]\nPrefix=${QT_LIB_PATH}\n" ) endif() From 0be4feff2c16f5efc2c972d96588b8ac50ed6e47 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 15 May 2019 14:38:42 -0700 Subject: [PATCH 72/81] remove sha512sum checks for now --- hifi_vcpkg.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 576b200ea4..faa1842395 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -245,31 +245,26 @@ endif() dest = os.path.join(self.path, 'installed') url = 'NOT DEFINED' - sha512sum = None if platform.system() == 'Windows': # TODO: figure out how to download with versionId #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz?versionId=Etx8novAe0.IxQ7AosLFtop7fZur.cx9' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-windows.tar.gz' - sha512sum = 'c0d1416d28ff8f4570651cf7d18857709f573567d34ac66f62a368983b8643dde20806b8c1de19886cd60b5586d98aa49f109b15a842def82ab3c4f76419d99e' elif platform.system() == 'Darwin': #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz?versionId=QrGxwssB.WwU_z3QCyG7ghP1_VjTkQeK' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-macos.tar.gz' - sha512sum = '025a1aa258f6ca41c9544e1ab871b7af5fde891fc2be2cbfca3ba6c89f40c7cf5794997f5e78e83dc20fa0aaeab7223f2c82923df1ce698bdc87fe4f2aebf23f' elif platform.system() == 'Linux': if platform.linux_distribution()[1] == '16.04': #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz?versionId=c9j7PW4uBDPLif7DKmgIhorh9WBMjZRB' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-16.04.tar.gz' - sha512sum = '290fdf0ac1bbc54791650bcff971dc69502bbacbcc88f69a9f439d23a5ca5c114a2d7d8bd354c29abfd48e20d0757aaf1eac3d12bac8b207d9ab6ad24b5f30b8' elif platform.linux_distribution()[1] == '18.04': #url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz?versionId=Z3TojPFdb5pXdahF3oi85jjKocpL0xqw' url = 'https://hifi-public.s3.amazonaws.com/dependencies/vcpkg/qt5-install-5.12.3-ubuntu-18.04.tar.gz' - sha512sum = '74bcce1879251ec5e78b82d9b99a73a5b94698a4937ba91d6abf0047daee08d21cab364be6cbda8bb97e1f4cfa35c931bd42265032bff468d0ecbc0b8f5fab77' else: print('UNKNOWN LINUX VERSION!!!') else: print('UNKNOWN OPERATING SYSTEM!!!') print('Extracting ' + url + ' to ' + dest) - hifi_utils.downloadAndExtract(url, dest, sha512sum) + hifi_utils.downloadAndExtract(url, dest) else: print ('Qt has already been downloaded') From abc5a0e7e8f8bbc2ef9a01a9bf624027dc6691aa Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 15 May 2019 14:59:58 -0700 Subject: [PATCH 73/81] remove symbols for Release build --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6eedd380cd..49ac30b5db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,9 @@ project(hifi) include("cmake/init.cmake") include("cmake/compiler.cmake") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") + add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/bin) add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/debug/bin) From a4d43bbff904667d24c8fcbb8d6adacff50c8884 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Wed, 15 May 2019 15:54:58 -0700 Subject: [PATCH 74/81] more correct stripping of symbols APPLE and UNIX --- CMakeLists.txt | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49ac30b5db..22a62c19cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,9 +42,6 @@ project(hifi) include("cmake/init.cmake") include("cmake/compiler.cmake") -set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") -set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") - add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/bin) add_paths_to_fixup_libs(${VCPKG_INSTALL_ROOT}/debug/bin) @@ -199,6 +196,15 @@ unset(JS_SRC) set_packaging_parameters() +if (PRODUCTION_BUILD) + if (APPLE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s") + elseif(UNIX) + set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") + endif() +endif() + # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}") From 595edb9f6ecfaa61660b636e09ed7e30eaf0eab6 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 May 2019 12:29:37 -0700 Subject: [PATCH 75/81] more correct QT_VERSION detection --- CMakeLists.txt | 6 ++-- cmake/macros/SetupQt.cmake | 58 ++++++++++++++++++++++++++++++++------ hifi_vcpkg.py | 23 +++++++-------- 3 files changed, 66 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22a62c19cd..eb4c82b599 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,8 +36,8 @@ endif() if(NOT EXISTS "${CMAKE_BINARY_DIR}/vcpkg.cmake") message(FATAL_ERROR "vcpkg configuration missing.") endif() - include("${CMAKE_BINARY_DIR}/vcpkg.cmake") + project(hifi) include("cmake/init.cmake") include("cmake/compiler.cmake") @@ -196,7 +196,9 @@ unset(JS_SRC) set_packaging_parameters() -if (PRODUCTION_BUILD) +if (NOT DEV_BUILD) + # add options to strip symbols for PRODUCTION and PR builds + # TODO?: call set_packaging_parameters() earlier and move this symbol stripping into compiler.cmake if (APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s") elseif(UNIX) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 2580697d7a..18b4f5aecc 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -5,34 +5,76 @@ # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # +function(get_sub_directories result curdir) + file(GLOB children RELATIVE ${curdir} ${curdir}/*) + set(dirlist "") + foreach(child ${children}) + if(IS_DIRECTORY ${curdir}/${child}) + LIST(APPEND dirlist ${child}) + endif() + endforeach() + set(${result} ${dirlist} PARENT_SCOPE) +endfunction() + +function(calculate_qt5_version result _QT_DIR) + # All Qt5 packages have little "private" include directories named with the actual Qt version such as: + # .../include/QtCore/5.12.3/QtCore/private + # Sometimes we need to include these private headers for debug hackery. + # Hence we find one of these directories and pick apart its path to determine the actual QT_VERSION. + set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + if(NOT EXISTS "${_QT_CORE_DIR}") + message(FATAL_ERROR "Could not find 'include/QtCore' in '${_QT_DIR}'") + endif() + set(subdirs "") + get_sub_directories(subdirs ${_QT_CORE_DIR}) + + foreach(subdir ${subdirs}) + string(REGEX MATCH "5.[0-9]+.[0-9]+$" _QT_VERSION ${subdir}) + if (NOT "${_QT_VERSION}" STREQUAL "") + # found it! + set(${result} "${_QT_VERSION}" PARENT_SCOPE) + break() + endif() + endforeach() +endfunction() + # Sets the QT_CMAKE_PREFIX_PATH and QT_DIR variables # Also enables CMAKE_AUTOMOC and CMAKE_AUTORCC macro(setup_qt) # if we are in a development build and QT_CMAKE_PREFIX_PATH is specified # then use it, # otherwise, use the vcpkg'ed version - if (RELEASE_TYPE STREQUAL "DEV" AND DEFINED ENV{QT_CMAKE_PREFIX_PATH}) - message("Development build and QT_CMAKE_PREFIX_PATH is defined in environment - using this path for Qt") - set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) + if(NOT DEFINED VCPKG_QT_CMAKE_PREFIX_PATH) + message(FATAL_ERROR "VCPKG_QT_CMAKE_PREFIX_PATH should have been set by hifi_vcpkg.py") + endif() + if (NOT DEFINED ENV{QT_CMAKE_PREFIX_PATH} OR NOT DEV_BUILD) + # HACK we ignore QT_CMAKE_PREFIX_PATH for PRODUCTION and PR builds + # so we can punt updating the automated build OS images while switching to vcpkg for Qt + set(QT_CMAKE_PREFIX_PATH ${VCPKG_QT_CMAKE_PREFIX_PATH}) else() - message(" Using vcpkg'ed version of Qt") + set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) endif() # figure out where the qt dir is get_filename_component(QT_DIR "${QT_CMAKE_PREFIX_PATH}/../../" ABSOLUTE) + set(QT_VERSION "unknown") + calculate_qt5_version(QT_VERSION "${QT_DIR}") + if (QT_VERSION STREQUAL "unknown") + message(FATAL_ERROR "Could not determine QT_VERSION") + endif() - if (WIN32) + if(WIN32) # windows shell does not like backslashes expanded on the command line, # so convert all backslashes in the QT path to forward slashes string(REPLACE \\ / QT_CMAKE_PREFIX_PATH ${QT_CMAKE_PREFIX_PATH}) string(REPLACE \\ / QT_DIR ${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}") + if(NOT EXISTS "${QT_CMAKE_PREFIX_PATH}/Qt5Core/Qt5CoreConfig.cmake") + message(FATAL_ERROR "Unable to locate Qt5CoreConfig.cmake in '${QT_CMAKE_PREFIX_PATH}'") endif() - message(STATUS "The Qt build in use is: \"${QT_DIR}\"") + message(STATUS "Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index faa1842395..77e0c70ecf 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -15,11 +15,12 @@ print = functools.partial(print, flush=True) # Encapsulates the vcpkg system class VcpkgRepo: CMAKE_TEMPLATE = """ +# this file auto-generated by hifi_vcpkg.py get_filename_component(CMAKE_TOOLCHAIN_FILE "{}" ABSOLUTE CACHE) get_filename_component(CMAKE_TOOLCHAIN_FILE_UNCACHED "{}" ABSOLUTE) set(VCPKG_INSTALL_ROOT "{}") set(VCPKG_TOOLS_DIR "{}") -set(QT_CMAKE_PREFIX_PATH "{}") +set(VCPKG_QT_CMAKE_PREFIX_PATH "{}") """ CMAKE_TEMPLATE_NON_ANDROID = """ @@ -218,17 +219,17 @@ endif() cmakeScript = os.path.join(self.path, 'scripts/buildsystems/vcpkg.cmake') installPath = os.path.join(self.path, 'installed', self.triplet) toolsPath = os.path.join(self.path, 'installed', self.hostTriplet, 'tools') - cmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') - cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE - if not self.args.android: - cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID - else: - precompiled = os.path.realpath(self.androidPackagePath) - qtCmakePrefix = os.path.realpath(os.path.join(precompiled, 'qt/lib/cmake')) - cmakeTemplate += 'set(HIFI_ANDROID_PRECOMPILED "{}")\n'.format(precompiled) - cmakeTemplate += 'set(QT_CMAKE_PREFIX_PATH "{}")\n'.format(qtCmakePrefix) - cmakeConfig = cmakeTemplate.format(cmakeScript, cmakeScript, installPath, toolsPath, cmakePrefixPath).replace('\\', '/') + cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE + qtCmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') + if self.args.android: + precompiled = os.path.realpath(self.androidPackagePath) + cmakeTemplate += 'set(HIFI_ANDROID_PRECOMPILED "{}")\n'.format(precompiled) + qtCmakePrefixPath = os.path.realpath(os.path.join(precompiled, 'qt/lib/cmake')) + else: + cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID + + cmakeConfig = cmakeTemplate.format(cmakeScript, cmakeScript, installPath, toolsPath, qtCmakePrefixPath).replace('\\', '/') with open(self.configFilePath, 'w') as f: f.write(cmakeConfig) From 3e63734123944cd270cc7eb289967d38de9838d5 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 May 2019 13:50:23 -0700 Subject: [PATCH 76/81] more correct QT_VERSION detection for MacOS --- cmake/macros/SetupQt.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 18b4f5aecc..b6ebaf6239 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -21,7 +21,11 @@ function(calculate_qt5_version result _QT_DIR) # .../include/QtCore/5.12.3/QtCore/private # Sometimes we need to include these private headers for debug hackery. # Hence we find one of these directories and pick apart its path to determine the actual QT_VERSION. - set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + if (APPLE) + set(_QT_CORE_DIR "${_QT_DIR}/lib/QtCore.framework/Versions/5/Headers") + else() + set(_QT_CORE_DIR "${_QT_DIR}/include/QtCore") + endif() if(NOT EXISTS "${_QT_CORE_DIR}") message(FATAL_ERROR "Could not find 'include/QtCore' in '${_QT_DIR}'") endif() @@ -74,7 +78,9 @@ macro(setup_qt) message(FATAL_ERROR "Unable to locate Qt5CoreConfig.cmake in '${QT_CMAKE_PREFIX_PATH}'") endif() - message(STATUS "Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") + message("adebug") + message("adebug Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") + message("adebug") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) From 9e8d604373e94c225b7298d0a0aae7771b6ad634 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 May 2019 16:35:16 -0700 Subject: [PATCH 77/81] remove debug logs --- cmake/macros/SetupQt.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index b6ebaf6239..316172a204 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -78,9 +78,7 @@ macro(setup_qt) message(FATAL_ERROR "Unable to locate Qt5CoreConfig.cmake in '${QT_CMAKE_PREFIX_PATH}'") endif() - message("adebug") - message("adebug Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") - message("adebug") + message(STATUS "Using Qt build in : '${QT_DIR}' with version ${QT_VERSION}") # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) From f4d9aa71a4d671cf4a69b5246fe5874f7302e1d3 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Thu, 16 May 2019 16:35:49 -0700 Subject: [PATCH 78/81] remove manual symbol stripping --- CMakeLists.txt | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb4c82b599..ae2183e427 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,17 +196,6 @@ unset(JS_SRC) set_packaging_parameters() -if (NOT DEV_BUILD) - # add options to strip symbols for PRODUCTION and PR builds - # TODO?: call set_packaging_parameters() earlier and move this symbol stripping into compiler.cmake - if (APPLE) - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-s") - elseif(UNIX) - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") - endif() -endif() - # Locate the required Qt build on the filesystem setup_qt() list(APPEND CMAKE_PREFIX_PATH "${QT_CMAKE_PREFIX_PATH}") From 528a64c6188f49a9c7089deaf624504ba4991c7a Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Sat, 18 May 2019 06:45:25 -0700 Subject: [PATCH 79/81] hack QT_CMAKE_PREFIX_PATH for Jenkins macos builds --- CMakeLists.txt | 9 +++++++-- cmake/macros/SetupQt.cmake | 8 +++++++- hifi_vcpkg.py | 19 +++++++++++++++---- prebuild.py | 1 + 4 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae2183e427..1f6cffb7c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,14 +17,19 @@ if (APPLE) set(ENV{MACOSX_DEPLOYMENT_TARGET} 10.9) endif() +set(RELEASE_TYPE "$ENV{RELEASE_TYPE}") +if ((NOT "${RELEASE_TYPE}" STREQUAL "PRODUCTION") AND (NOT "${RELEASE_TYPE}" STREQUAL "PR")) + set(RELEASE_TYPE "DEV") +endif() + if (HIFI_ANDROID) execute_process( - COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --android ${HIFI_ANDROID_APP} --build-root ${CMAKE_BINARY_DIR} + COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --android ${HIFI_ANDROID_APP} --build-root ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) else() execute_process( - COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --build-root ${CMAKE_BINARY_DIR} + COMMAND ${HIFI_PYTHON_EXEC} ${CMAKE_CURRENT_SOURCE_DIR}/prebuild.py --release-type ${RELEASE_TYPE} --build-root ${CMAKE_BINARY_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) # squelch the Policy CMP0074 warning without requiring an update to cmake 3.12. diff --git a/cmake/macros/SetupQt.cmake b/cmake/macros/SetupQt.cmake index 316172a204..45ddd87035 100644 --- a/cmake/macros/SetupQt.cmake +++ b/cmake/macros/SetupQt.cmake @@ -54,7 +54,13 @@ macro(setup_qt) if (NOT DEFINED ENV{QT_CMAKE_PREFIX_PATH} OR NOT DEV_BUILD) # HACK we ignore QT_CMAKE_PREFIX_PATH for PRODUCTION and PR builds # so we can punt updating the automated build OS images while switching to vcpkg for Qt - set(QT_CMAKE_PREFIX_PATH ${VCPKG_QT_CMAKE_PREFIX_PATH}) + if (APPLE AND NOT DEV_BUILD) + # DOUBLE HACK for Jenkins + macos build: always store qt5 in /var/tmp/ + # because that is where the manually-edited hard-coded path thinks it is + set(QT_CMAKE_PREFIX_PATH "/var/tmp/qt5-install/lib/cmake") + else() + set(QT_CMAKE_PREFIX_PATH ${VCPKG_QT_CMAKE_PREFIX_PATH}) + endif() else() set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH}) endif() diff --git a/hifi_vcpkg.py b/hifi_vcpkg.py index 77e0c70ecf..3df714e6f9 100644 --- a/hifi_vcpkg.py +++ b/hifi_vcpkg.py @@ -213,6 +213,17 @@ endif() with open(self.tagFile, 'w') as f: f.write(self.tagContents) + def getQt5InstallPath(self): + qt5InstallPath = os.path.join(self.path, 'installed', 'qt5-install') + if platform.system() == "Darwin" and self.args.release_type != "DEV": + # HACK for MacOS Jenkins PRODUCTION and PR builds during Qt-5.12.3 transition + # we always supply /var/tmp/qt5-install for QT_CMAKE_PREFIX_PATH + qt5InstallPath = "/var/tmp/qt5-install" + elif self.args.android: + precompiled = os.path.realpath(self.androidPackagePath) + qt5InstallPath = os.path.realpath(os.path.join(precompiled, 'qt')) + return qt5InstallPath + def writeConfig(self): print("Writing cmake config to {}".format(self.configFilePath)) # Write out the configuration for use by CMake @@ -221,14 +232,13 @@ endif() toolsPath = os.path.join(self.path, 'installed', self.hostTriplet, 'tools') cmakeTemplate = VcpkgRepo.CMAKE_TEMPLATE - qtCmakePrefixPath = os.path.join(self.path, 'installed', 'qt5-install/lib/cmake') if self.args.android: precompiled = os.path.realpath(self.androidPackagePath) cmakeTemplate += 'set(HIFI_ANDROID_PRECOMPILED "{}")\n'.format(precompiled) - qtCmakePrefixPath = os.path.realpath(os.path.join(precompiled, 'qt/lib/cmake')) else: cmakeTemplate += VcpkgRepo.CMAKE_TEMPLATE_NON_ANDROID + qtCmakePrefixPath = os.path.join(self.getQt5InstallPath(), "lib/cmake") cmakeConfig = cmakeTemplate.format(cmakeScript, cmakeScript, installPath, toolsPath, qtCmakePrefixPath).replace('\\', '/') with open(self.configFilePath, 'w') as f: f.write(cmakeConfig) @@ -241,9 +251,10 @@ endif() def installQt(self): - if not os.path.isdir(os.path.join(self.path, 'installed', 'qt5-install')): + qt5InstallPath = self.getQt5InstallPath() + if not os.path.isdir(qt5InstallPath): print ('Downloading Qt from AWS') - dest = os.path.join(self.path, 'installed') + dest, tail = os.path.split(qt5InstallPath) url = 'NOT DEFINED' if platform.system() == 'Windows': diff --git a/prebuild.py b/prebuild.py index b401c94e7f..1fb96290b3 100644 --- a/prebuild.py +++ b/prebuild.py @@ -91,6 +91,7 @@ def parse_args(): parser.add_argument('--debug', action='store_true') parser.add_argument('--force-bootstrap', action='store_true') parser.add_argument('--force-build', action='store_true') + parser.add_argument('--release-type', type=str, default="DEV", help="DEV, PR, or PRODUCTION") parser.add_argument('--vcpkg-root', type=str, help='The location of the vcpkg distribution') 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) From 9b78edd0625b3d7d9eb0ff85e157acd0890cd21f Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 20 May 2019 11:50:09 -0400 Subject: [PATCH 80/81] more correct qt.conf for Linux and MacOS dev environment --- interface/CMakeLists.txt | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 85364d08d2..0b94c4296d 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -403,25 +403,16 @@ endif() if (APPLE OR UNIX) # need to worry about hard-coded search paths in the Qt libraries - set(QT_LIB_PATH "${VCPKG_INSTALL_ROOT}/../qt5-install") + set(QT_LIB_PATH "${QT_CMAKE_PREFIX_PATH}/../..") if (APPLE) set(QT_CONF_FILE "${RESOURCES_DEV_DIR}/../Resources/qt.conf") else () set(QT_CONF_FILE "${INTERFACE_EXEC_DIR}/qt.conf") endif () - if (DEFINED ENV{QT_CMAKE_PREFIX_PATH}) - # using VCPKG-installed Qt rather than a custom install - # TODO: erase old qt.conf file if it exists - # HINT: the file(REMOVE) operation below does not succeed - #file(REMOVE ${QT_CONF_FILE}) - else () - # using VCPKG-installed Qt rather than a custom install - # need to create qt.conf file to override hard coded - file(GENERATE - OUTPUT "${QT_CONF_FILE}" - CONTENT "[Paths]\nPrefix=${QT_LIB_PATH}\n" - ) - endif() + file(GENERATE + OUTPUT "${QT_CONF_FILE}" + CONTENT "[Paths]\nPrefix=${QT_LIB_PATH}\n" + ) endif() if (SCRIPTS_INSTALL_DIR) From f2f11b9509d2ddd2507178b08ecf15e64ba0be84 Mon Sep 17 00:00:00 2001 From: Andrew Meadows Date: Mon, 20 May 2019 15:00:07 -0400 Subject: [PATCH 81/81] only build qt.conf for DEV macos and unix builds --- interface/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 0b94c4296d..9553b571c5 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -401,8 +401,8 @@ else() endif() endif() -if (APPLE OR UNIX) - # need to worry about hard-coded search paths in the Qt libraries +if (DEV_BUILD AND (APPLE OR UNIX)) + # create a qt.conf file to override hard-coded search paths in Qt libs set(QT_LIB_PATH "${QT_CMAKE_PREFIX_PATH}/../..") if (APPLE) set(QT_CONF_FILE "${RESOURCES_DEV_DIR}/../Resources/qt.conf")