-
Notifications
You must be signed in to change notification settings - Fork 529
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
fix(cmake): Replace deprecated FetchContent_Populate
with FetchContent_MakeAvailable
#4309
Conversation
…t_MakeAvailable Update `source/lmp/plugin/CMakeLists.txt` to use `FetchContent_MakeAvailable` instead of `FetchContent_Populate`. * Replace `FetchContent_Populate(lammps_download)` with `FetchContent_MakeAvailable(lammps_download)` on line 13. * Remove `FetchContent_GetProperties` and `if(NOT lammps_download_POPULATED)` block. This fixes a CMake warning: ``` CMake Warning (dev) at /home/runner/work/_temp/-111029589/cmake-3.30.5-linux-x86_64/share/cmake-3.30/Modules/FetchContent.cmake:1953 (message): Calling FetchContent_Populate(lammps_download) is deprecated, call FetchContent_MakeAvailable(lammps_download) instead. Policy CMP0169 can be set to OLD to allow FetchContent_Populate(lammps_download) to be called directly for now, but the ability to call it with declared details will be removed completely in a future version. Call Stack (most recent call first): lmp/plugin/CMakeLists.txt:13 (FetchContent_Populate) This warning is for project developers. Use -Wno-dev to suppress it. ``` --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/njzjz/deepmd-kit?shareId=XXXX-XXXX-XXXX-XXXX).
for more information, see https://pre-commit.ci
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request modifies the CMake configuration for the LAMMPS plugin by simplifying the logic for fetching and configuring the LAMMPS source. It eliminates conditional checks for the Changes
Possibly related PRs
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
source/lmp/plugin/CMakeLists.txt (1)
11-12
: Add a comment explaining the CMake version requirement.Consider adding a comment to document that
FetchContent_MakeAvailable
requires CMake 3.14 or later.+ # FetchContent_MakeAvailable requires CMake 3.14 or later FetchContent_MakeAvailable(lammps_download) set(LAMMPS_SOURCE_ROOT ${lammps_download_SOURCE_DIR})
Signed-off-by: Jinzhe Zeng <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4309 +/- ##
==========================================
- Coverage 84.40% 84.34% -0.07%
==========================================
Files 567 570 +3
Lines 52910 53070 +160
Branches 3054 3054
==========================================
+ Hits 44661 44760 +99
- Misses 7290 7350 +60
- Partials 959 960 +1 ☔ View full report in Codecov by Sentry. |
Update
source/lmp/plugin/CMakeLists.txt
to useFetchContent_MakeAvailable
instead ofFetchContent_Populate
.FetchContent_Populate(lammps_download)
withFetchContent_MakeAvailable(lammps_download)
on line 13.FetchContent_GetProperties
andif(NOT lammps_download_POPULATED)
block.This fixes a CMake warning:
For more details, open the Copilot Workspace session.
Summary by CodeRabbit