Skip to content

Commit

Permalink
CMake: FindDependency CUDAToolkit (AMReX-Codes#2849)
Browse files Browse the repository at this point in the history
If we install AMReX with CUDA support using a modern
CMake, we need to repopulate targets such as `CUDA::curand`
from `find_dependency` for downstream.
Downstream users find us via `find_package` and that target
link dependency showed up to be unpopulated in MFIX.
  • Loading branch information
ax3l authored Jun 28, 2022
1 parent 027f2ff commit 21fe4b3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tools/CMake/AMReXConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ endif ()
# CUDA
#
# AMReX 21.06+ supports CUDA_ARCHITECTURES
if(CMAKE_VERSION VERSION_LESS 3.20)
if (@AMReX_CUDA@)
include(AMReX_SetupCUDA)
endif ()
if (@AMReX_CUDA@)
if (CMAKE_VERSION VERSION_LESS 3.20)
include(AMReX_SetupCUDA)
else ()
find_dependency(CUDAToolkit REQUIRED)
endif ()
endif ()

include( "${CMAKE_CURRENT_LIST_DIR}/AMReXTargets.cmake" )
Expand Down

0 comments on commit 21fe4b3

Please sign in to comment.