From 331f692e34929d9d9d579da724fb942e4131ede4 Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 17:39:02 -0700 Subject: [PATCH 01/25] 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 c05ac9a5dda9c92930c222bb858538f19999cf5e Mon Sep 17 00:00:00 2001 From: NissimHadar Date: Wed, 24 Apr 2019 17:51:27 -0700 Subject: [PATCH 02/25] 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 03/25] 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 04/25] 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 05/25] 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 06/25] 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 07/25] 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 08/25] 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 09/25] 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 10/25] 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 11/25] 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 12/25] 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 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] 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 19/25] 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 20/25] 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 21/25] 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 22/25] 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 23/25] 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 24/25] 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 25/25] 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.