mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Help: Demonstrate using set_target_properties with CUDA architectures
A common anti-pattern is to copy from the `CUDA_ARCHITECTURES` documentation. If at any point the user tries to simplify by changin `set_property` to `set_target_properties` the code breaks. To better train users, provide and example of how to set multiple CUDA architectures with `set_target_properties`.
This commit is contained in:
@@ -41,7 +41,7 @@ Examples
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 35 50 72)
|
||||
set_target_properties(tgt PROPERTIES CUDA_ARCHITECTURES "35;50;72")
|
||||
|
||||
Generates code for real and virtual architectures ``30``, ``50`` and ``72``.
|
||||
|
||||
|
@@ -25,7 +25,7 @@ Examples
|
||||
|
||||
.. code-block:: cmake
|
||||
|
||||
set_property(TARGET tgt PROPERTY CUDA_ARCHITECTURES 35 50 72)
|
||||
set_target_properties(tgt PROPERTIES CUDA_ARCHITECTURES "35;50;72")
|
||||
|
||||
Generates code for real and virtual architectures ``30``, ``50`` and ``72``.
|
||||
|
||||
|
Reference in New Issue
Block a user