diff options
author | Raul Tambre <raul@tambre.ee> | 2021-01-10 10:06:02 (GMT) |
---|---|---|
committer | Raul Tambre <raul@tambre.ee> | 2021-01-10 10:06:02 (GMT) |
commit | baa530fe9f48d08e564c2f13e21f81dff26fb232 (patch) | |
tree | 3d8994eb0d034d3e8573f3c788f1565e36a8e3e3 /Help/variable/CMAKE_CUDA_ARCHITECTURES.rst | |
parent | aaebbd200bfc4c4802f95daf472fccc69cc04dd8 (diff) | |
download | CMake-baa530fe9f48d08e564c2f13e21f81dff26fb232.zip CMake-baa530fe9f48d08e564c2f13e21f81dff26fb232.tar.gz CMake-baa530fe9f48d08e564c2f13e21f81dff26fb232.tar.bz2 |
Help: Add example for setting default CMAKE_CUDA_ARCHITECTURES value
Fixes #21302 and #21666.
Diffstat (limited to 'Help/variable/CMAKE_CUDA_ARCHITECTURES.rst')
-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. |