diff options
author | Brad King <brad.king@kitware.com> | 2016-07-01 13:12:36 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-07-01 13:12:36 (GMT) |
commit | cff9c11de779e44f3deceaa46f4adf31491b44e8 (patch) | |
tree | 302ba72f49e58f7bf3870682051e6504d9d80668 /Help | |
parent | f408a5b1b9ebb7649537b78cf1303b46860eafee (diff) | |
parent | c05d240ef7b4705e6a03d29a432412672193c11c (diff) | |
download | CMake-cff9c11de779e44f3deceaa46f4adf31491b44e8.zip CMake-cff9c11de779e44f3deceaa46f4adf31491b44e8.tar.gz CMake-cff9c11de779e44f3deceaa46f4adf31491b44e8.tar.bz2 |
Merge topic 'doc-updates'
c05d240e Help: Document CMAKE_TRY_COMPILE_PLATFORM_VARIABLES example
dab3ccf2 InstallRequiredSystemLibraries: Document UCRT option use case
Diffstat (limited to 'Help')
-rw-r--r-- | Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst index 8e43465..0f96787 100644 --- a/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst +++ b/Help/variable/CMAKE_TRY_COMPILE_PLATFORM_VARIABLES.rst @@ -8,3 +8,19 @@ the host project. This variable should not be set by project code. It is meant to be set by CMake's platform information modules for the current toolchain, or by a toolchain file when used with :variable:`CMAKE_TOOLCHAIN_FILE`. + +Variables meaningful to CMake, such as :variable:`CMAKE_<LANG>_FLAGS`, are +propagated automatically. The ``CMAKE_TRY_COMPILE_PLATFORM_VARIABLES`` +variable may be set to pass custom variables meaningful to a toolchain file. +For example, a toolchain file may contain: + +.. code-block:: cmake + + set(CMAKE_SYSTEM_NAME ...) + set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES MY_CUSTOM_VARIABLE) + # ... use MY_CUSTOM_VARIABLE ... + +If a user passes ``-DMY_CUSTOM_VARIABLE=SomeValue`` to CMake then this +setting will be made visible to the toolchain file both for the main +project and for test projects generated by the :command:`try_compile` +command source file signature. |