diff options
author | Brad King <brad.king@kitware.com> | 2021-01-12 15:29:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-01-12 15:29:43 (GMT) |
commit | d59135312681d9e442ea026c35f892d55862fcda (patch) | |
tree | ba1a50c901b038353b2ffd019c622889ebbaaa0f | |
parent | bd0700d1079a6eab32b5fa1dff651027bc27b7f3 (diff) | |
parent | baa530fe9f48d08e564c2f13e21f81dff26fb232 (diff) | |
download | CMake-d59135312681d9e442ea026c35f892d55862fcda.zip CMake-d59135312681d9e442ea026c35f892d55862fcda.tar.gz CMake-d59135312681d9e442ea026c35f892d55862fcda.tar.bz2 |
Merge topic 'cuda_architectures_default_doc'
baa530fe9f Help: Add example for setting default CMAKE_CUDA_ARCHITECTURES value
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5685
-rw-r--r-- | Help/variable/CMAKE_CUDA_ARCHITECTURES.rst | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst index 7f7e679..d885516 100644 --- a/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst +++ b/Help/variable/CMAKE_CUDA_ARCHITECTURES.rst @@ -18,3 +18,18 @@ and compiler versions. This variable is used to initialize the :prop_tgt:`CUDA_ARCHITECTURES` property on all targets. See the target property for additional information. + +Examples +^^^^^^^^ + +.. code-block:: cmake + + cmake_minimum_required(VERSION) + + if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) + set(CMAKE_CUDA_ARCHITECTURES 75) + endif() + + project(example LANGUAGES CUDA) + +``CMAKE_CUDA_ARCHITECTURES`` will default to ``75`` unless overridden by the user. |