diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-07-03 09:08:45 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-07-03 09:08:45 (GMT) |
commit | 581e011cefefea4a5ad826aac6bcbd66b4b68f3b (patch) | |
tree | 04ed4581af104803e53291a06c13e62f26ea8191 | |
parent | c56201bdac81d3d74efa9437a7ed2cef4285de6d (diff) | |
parent | 16434fe303a6bd8394a07177e3cef928b446f918 (diff) | |
download | CMake-581e011cefefea4a5ad826aac6bcbd66b4b68f3b.zip CMake-581e011cefefea4a5ad826aac6bcbd66b4b68f3b.tar.gz CMake-581e011cefefea4a5ad826aac6bcbd66b4b68f3b.tar.bz2 |
Merge topic 'doc-toolchain-file-CMAKE_SOURCE_DIR' into release-3.15
Merge-request: !3495
-rw-r--r-- | Help/manual/cmake-toolchains.7.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst index df4531b..7435d9a 100644 --- a/Help/manual/cmake-toolchains.7.rst +++ b/Help/manual/cmake-toolchains.7.rst @@ -101,6 +101,14 @@ values for the compilers. The :variable:`CMAKE_CROSSCOMPILING` variable is set to true when CMake is cross-compiling. +Note that using the :variable:`CMAKE_SOURCE_DIR` or :variable:`CMAKE_BINARY_DIR` +variables inside a toolchain file is typically undesirable. The toolchain +file is used in contexts where these variables have different values when used +in different places (e.g. as part of a call to :command:`try_compile`). In most +cases, where there is a need to evaluate paths inside a toolchain file, the more +appropriate variable to use would be :variable:`CMAKE_CURRENT_LIST_DIR`, since +it always has an unambiguous, predictable value. + Cross Compiling for Linux ------------------------- |