Skip to content

Commit

Permalink
AMReXBuildInfo.cmake: AMReX_DIR (#3609)
Browse files Browse the repository at this point in the history
## Summary

The `AMReX_DIR` points if set to the CMake module path root.

The old logic did not work for me in a situation (ImpactX) where:
- AMReX is pre-installed but
- found through a superbuild of another transient lib (ABLASTR)

## Additional background

Follow-up to #3599

## Checklist

The proposed changes:
- [x] fix a bug or incorrect behavior in AMReX
- [ ] add new capabilities to AMReX
- [ ] changes answers in the test suite to more than roundoff level
- [ ] are likely to significantly affect the results of downstream AMReX
users
- [ ] include documentation in the code and/or rst files, if appropriate
  • Loading branch information
ax3l committed Oct 26, 2023
1 parent 152fdac commit be6c641
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tools/CMake/AMReXBuildInfo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ include(AMReXTargetHelpers)
#
# Set paths
#
if (AMReX_FOUND)
if (AMReX_DIR)
# AMReX is pre-installed and used as a library
if (WIN32) # see AMReXInstallHelpers.cmake
string(REPLACE "/cmake/AMReXCMakeModules" ""
Expand All @@ -56,7 +56,7 @@ else ()
endif ()
set(AMREX_TOP_DIR "${AMREX_TOP_DIR_DEFAULT}" CACHE INTERNAL "Top level AMReX directory")

if (AMReX_FOUND)
if (AMReX_DIR)
# AMReX is pre-installed and used as a library
set(AMREX_C_SCRIPTS_DIR "${AMREX_TOP_DIR}/share/amrex/C_scripts"
CACHE INTERNAL "Path to AMReX' C_scripts dir")
Expand Down

0 comments on commit be6c641

Please sign in to comment.