Improve build variables documentation

This commit is contained in:
Marius Kittler 2018-07-13 15:36:53 +02:00
parent 7e4d9a6c59
commit eb98b98c03
1 changed files with 26 additions and 4 deletions

View File

@ -99,6 +99,13 @@ the location of libraries and include directories directly:
* `dependency_STATIC_INCLUDE_DIR`: specifies the locations of the additional * `dependency_STATIC_INCLUDE_DIR`: specifies the locations of the additional
include directories required for using the static version of the *dependency* include directories required for using the static version of the *dependency*
*Note about Qt*: Qt modules are always configured using the CMake packages via
`find_package`. So using the variables described above to specify a custom location
does not work. Instead, the variables `CMAKE_FIND_ROOT_PATH` or `CMAKE_PREFIX_PATH`
can be used to specify the install prefix of the Qt build to use. Set `QT_LINKAGE`
to `STATIC` if it is a static build of Qt.
##### Examples
Example of passing location of dynamic `iconv` and `zlib` to CMake: Example of passing location of dynamic `iconv` and `zlib` to CMake:
``` ```
/opt/osxcross/bin/x86_64-apple-darwin15-cmake \ /opt/osxcross/bin/x86_64-apple-darwin15-cmake \
@ -109,10 +116,25 @@ Example of passing location of dynamic `iconv` and `zlib` to CMake:
... ...
``` ```
*Note about Qt*: Qt modules must be located via `find_package`. So using the variables Here's an example of passing the location of the Android SDK/NDK to compile for Android.
described above to specify a custom location does not work. Instead, the This time the `iconv` library is located by specifying its install prefix via
variable `CMAKE_PREFIX_PATH` can be used to specify the install prefix of the `CMAKE_FIND_ROOT_PATH`. The include directories are not automatically added for that
Qt build to use. Set `QT_LINKAGE` to `STATIC` if it is a static build of Qt. library, so this must still be done manually:
```
_android_arch=arm64-v8a
cmake \
-DCMAKE_SYSTEM_NAME=Android \
-DCMAKE_SYSTEM_VERSION=21 \
-DCMAKE_ANDROID_ARCH_ABI=$_android_arch \
-DCMAKE_ANDROID_NDK=/opt/android-ndk \
-DCMAKE_ANDROID_SDK=/opt/android-sdk \
-DCMAKE_ANDROID_STL_TYPE=gnustl_shared \
-DCMAKE_INSTALL_PREFIX=/opt/android-libs/$_android_arch \
-DCMAKE_FIND_ROOT_PATH="/opt/android-ndk/sysroot;/opt/android-libs/$_android_arch" \
-Diconv_DYNAMIC_INCLUDE_DIR="/opt/android-libs/$_android_arch/include" \
-Diconv_STATIC_INCLUDE_DIR="/opt/android-libs/$_android_arch/include" \
...
```
#### Windows specific #### Windows specific
* `USE_NATIVE_FILE_BUFFER=ON/OFF`: use native function to open file streams * `USE_NATIVE_FILE_BUFFER=ON/OFF`: use native function to open file streams