-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Retain the original path to Kokkos and ArborX #723
base: master
Are you sure you want to change the base?
Conversation
find_package(Kokkos QUIET) | ||
if(NOT Kokkos_FOUND) | ||
# If Kokkos was not found, try to use Kokkos used when building Cabana | ||
set(Kokkos_DIR @Kokkos_DIR@) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(Kokkos_DIR @Kokkos_DIR@) | |
if(NOT Kokkos_DIR) | |
set(Kokkos_DIR @Kokkos_DIR@) | |
endif() |
So the user can still overwrite it if needed.
if(NOT Kokkos_FOUND) | ||
# If Kokkos was not found, try to use Kokkos used when building Cabana | ||
set(Kokkos_DIR @Kokkos_DIR@) | ||
find_dependency(Kokkos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_dependency(Kokkos) | |
find_dependency(Kokkos REQUIRED) |
@@ -12,14 +12,24 @@ | |||
include(CMakeFindDependencyMacro) | |||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}" ) | |||
list(APPEND CMAKE_PREFIX_PATH @CMAKE_PREFIX_PATH@) | |||
find_dependency(Kokkos REQUIRED) | |||
find_package(Kokkos QUIET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_package(Kokkos QUIET) | |
find_dependency(Kokkos) |
find_dependency
handles QUIET
automatically.
set(Cabana_ENABLE_MPI @Cabana_ENABLE_MPI@) | ||
if(Cabana_ENABLE_MPI) | ||
find_dependency(MPI REQUIRED CXX) | ||
endif() | ||
set(Cabana_ENABLE_ARBORX @Cabana_ENABLE_ARBORX@) | ||
if(Cabana_ENABLE_ARBORX) | ||
find_dependency(ArborX REQUIRED) | ||
find_package(ArborX QUIET) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_package(ArborX QUIET) | |
find_dependency(ArborX) |
find_package(ArborX QUIET) | ||
if(NOT ArborX_FOUND) | ||
# If ArborX was not found, try to use ArborX used when building Cabana | ||
set(ArborX_DIR @ArborX_DIR@) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
set(ArborX_DIR @ArborX_DIR@) | |
if(NOT ArborX_DIR) | |
set(ArborX_DIR @ArborX_DIR@) | |
endif() |
if(NOT ArborX_FOUND) | ||
# If ArborX was not found, try to use ArborX used when building Cabana | ||
set(ArborX_DIR @ArborX_DIR@) | ||
find_dependency(ArborX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_dependency(ArborX) | |
find_dependency(ArborX REQUIRED) |
How do you mean we require |
Downstream Cabana libraries require specifying
Kokkos_ROOT
andArborX_ROOT
right now. This PR allows users to skip that and try to use the directories used during the build. I've only done these two because that's what I tested, but it could be expanded to all others.Similar approach was hardcoded in Cabana at some point, but was removed in #244.