This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61 (commit)
       via  16434fe303a6bd8394a07177e3cef928b446f918 (commit)
      from  f219b48d8afdaf1b72065158e00b3f42383cbb16 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61
commit 1cc8f85e1a167b786ecd2acb13c1455c9ecd5f61
Merge: f219b48 16434fe
Author:     Craig Scott <craig.sc...@crascit.com>
AuthorDate: Wed Jul 3 09:00:58 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Wed Jul 3 05:01:13 2019 -0400

    Merge topic 'doc-toolchain-file-CMAKE_SOURCE_DIR'
    
    16434fe303 Help: Discourage using CMAKE_SOURCE_DIR in toolchain files
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3495


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=16434fe303a6bd8394a07177e3cef928b446f918
commit 16434fe303a6bd8394a07177e3cef928b446f918
Author:     Oleg Chernovskiy <ado...@xaker.ru>
AuthorDate: Sat Jun 29 17:01:14 2019 +0300
Commit:     Craig Scott <craig.sc...@crascit.com>
CommitDate: Wed Jul 3 08:45:29 2019 +1000

    Help: Discourage using CMAKE_SOURCE_DIR in toolchain files
    
    Fixes: #19390

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
 -------------------------
 

-----------------------------------------------------------------------

Summary of changes:
 Help/manual/cmake-toolchains.7.rst | 8 ++++++++
 1 file changed, 8 insertions(+)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to