Skip to content
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 #214

Closed
wants to merge 1 commit into from

Conversation

njzjz
Copy link
Owner

@njzjz njzjz commented Nov 4, 2024

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.

…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).
@njzjz njzjz closed this Nov 4, 2024
@github-actions github-actions bot added the LAMMPS label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant