From 174d87063564978b7becfcfa0431271d89e9c9b6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 20 Jun 2019 14:15:59 +0200 Subject: Add support for picking up vcpkg automatically If VCPKG_ROOT is defined, let's use it and chainload any previously set toolchain file. The detection of vcpkg support via the VCPKG_ROOT environment variable is per vcpkg documentation, the automatic chainloading is something specific to us. Change-Id: I0498effc5b948f0b6f5e223d0454a15a0cbb503a Reviewed-by: Alexandru Croitor --- cmake/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cmake') diff --git a/cmake/README.md b/cmake/README.md index 868b4f2d33..1d00a438f5 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -27,9 +27,9 @@ You may use vcpkg to install dependencies needed to build QtBase. * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``qt-x64-windows-static`` or ``qt-x86-windows-static`` - * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` - * When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake`` - Previously CMAKE_PREFIX_PATH was mentioned instead of CMAKE_TOOLCHAIN_FILE. Setting CMAKE_PREFIX_PATH to the vcpkg installed folder is not enough, because then find_package is not overridden by vcpkg and cmake might not propagate all library dependencies for static packages (freetype is one such package). + * Set the ``VCPKG_ROOT`` environment variable to the path where you cloned vcpkg + * Build Qt dependencies: ``vcpkg install @qt-packages-windows.txt`` + * When running cmake in qtbase, support for vcpkg will be picked up automatically when the VCPKG_ROOT environment variable is set. # Building against homebrew on macOS @@ -138,11 +138,12 @@ Vcpkg for Android can be set up using the following steps: * ```git clone -b qt https://github.com/tronical/vcpkg``` * Run ```bootstrap-vcpkg.bat``` or ```bootstrap-vcpkg.sh``` * Set the ``VCPKG_DEFAULT_TRIPLET`` environment variable to ``arm-android`` + * Set the ``VCPKG_ROOT`` environment variable to the path where you cloned vcpkg * Set the ``ANDROID_NDK_HOME`` environment variable to the path where you have installed the Android NDK. * Set the ``ANDROID_SDK_HOME`` environment variable to the path where you have installed the Android SDK. - * Build Qt dependencies: ``vcpkg install zlib pcre2 harfbuzz freetype openssl zstd`` + * Build Qt dependencies: ``vcpkg install @qt-packages-android.txt`` -When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=/path/to/your/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` +When running cmake in qtbase, pass ``-DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake -DQT_HOST_PATH=/path/to/your/host/build -DANDROID_NATIVE_API_LEVEL=21 -DANDROID_SDK_ROOT=$ANDROID_SDK_HOME -DANDROID_STL=c++_shared -DCMAKE_INSTALL_PREFIX=$INSTALL_PATH`` # Debugging CMake files -- cgit v1.2.3