# Where to set CUDA\_ARCHITECTURES variable?

**URL:** <https://discourse.cmake.org/t/where-to-set-cuda-architectures-variable/4291>\
**Category:** Code\
**Created:** [October 15, 2021, 2:02pm UTC](https://discourse.cmake.org/t/where-to-set-cuda-architectures-variable/4291 "2021-10-15T14:02:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sharmin\_Sultana\_Sheu](https://discourse.cmake.org/user_avatar/discourse.cmake.org/sharmin_sultana_sheu/32/1096_2.png) [@Sharmin\_Sultana\_Sheu](https://discourse.cmake.org/u/Sharmin_Sultana_Sheu)\
**Post date:** [October 15, 2021, 2:02pm UTC](https://discourse.cmake.org/t/where-to-set-cuda-architectures-variable/4291/1 "2021-10-15T14:02:14Z")

</div>

Hi  
I am using CMAKE version 3.21.3  
And want to set CMake CUDA\_ARCHITECTURES variables with the commands

set\_property(TARGET myTarget PROPERTY CUDA\_ARCHITECTURES 35 50 72)  
target\_link\_libraries(FortranCInterface PUBLIC myTarget)

I don’t know which file should contain these commands, also what should I do afterwards to make it work?

Regards  
Sharmin

---

<div class="post-metadata">

**Author:** ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)\
**Post date:** [October 15, 2021, 11:22pm UTC](https://discourse.cmake.org/t/where-to-set-cuda-architectures-variable/4291/2 "2021-10-15T23:22:39Z")

</div>

Cc: @robert.maynard

---

<div class="post-metadata">

**Author:** ![robert.maynard](https://discourse.cmake.org/user_avatar/discourse.cmake.org/robert.maynard/32/4_2.png) [@robert.maynard](https://discourse.cmake.org/u/robert.maynard)\
**Post date:** [October 18, 2021, 6:41pm UTC](https://discourse.cmake.org/t/where-to-set-cuda-architectures-variable/4291/3 "2021-10-18T18:41:30Z")

</div>

> [@Sharmin\_Sultana\_Sheu](#):
>
> I don’t know which file should contain these commands, also what should I do afterwards to make it work?

Those commands need to go into the CMakeLists.txt that creates the `myTarget` target ( just after the `add_library` or `add_executable` of said target).
