Skip to content

cmake: replace include(FindFFTW.cmake) with find_dependency(FFTW) in installed config - #16

Merged
jrood-nrel merged 3 commits into
mainfrom
copilot/fix-cmake-warnings
Jul 30, 2026
Merged

cmake: replace include(FindFFTW.cmake) with find_dependency(FFTW) in installed config#16
jrood-nrel merged 3 commits into
mainfrom
copilot/fix-cmake-warnings

Conversation

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Downstream consumers of the installed package get a CMake developer warning because Waves2AMRConfig.cmake directly include()s FindFFTW.cmake, causing find_package_handle_standard_args(FFTW …) to fire while CMAKE_FIND_PACKAGE_NAME is still Waves2AMR — a name mismatch CMake flags as a bug.

Changes

  • cmake/Waves2AMRConfig.cmake.in: replace the include(…/FindFFTW.cmake) workaround with find_dependency(FFTW). The CMAKE_MODULE_PATH prepend (already present on line 3) makes FindFFTW.cmake discoverable, so find_dependency sets the correct CMAKE_FIND_PACKAGE_NAME=FFTW context before invoking the module.
  • Remove stale comments explaining why find_dependency(FFTW) "doesn't work" — it does, once CMAKE_MODULE_PATH is set first.
# Before
#This works upstream
include("${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_DATADIR@/cmake/Modules/FindFFTW.cmake")
#This does not and it feels like a bug because it doesn't invoke FindFFTW.cmake at all
#find_dependency(FFTW)

# After
find_dependency(FFTW)

Copilot AI changed the title [WIP] Fix CMake developer warning for FFTW dependency cmake: replace include(FindFFTW.cmake) with find_dependency(FFTW) in installed config Jul 30, 2026
Copilot AI requested a review from jrood-nrel July 30, 2026 19:23
@jrood-nrel
jrood-nrel marked this pull request as ready for review July 30, 2026 19:38
@jrood-nrel
jrood-nrel merged commit 3391cd3 into main Jul 30, 2026
1 check passed
@jrood-nrel
jrood-nrel deleted the copilot/fix-cmake-warnings branch July 30, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants