diff --git a/source/lmp/plugin/CMakeLists.txt b/source/lmp/plugin/CMakeLists.txt index f912059261..13da3d7114 100644 --- a/source/lmp/plugin/CMakeLists.txt +++ b/source/lmp/plugin/CMakeLists.txt @@ -2,17 +2,14 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION) message(STATUS "enable LAMMPS plugin mode") add_library(lammps_interface INTERFACE) if(DEFINED LAMMPS_VERSION) - cmake_minimum_required(VERSION 3.11) + cmake_minimum_required(VERSION 3.14) include(FetchContent) FetchContent_Declare( lammps_download GIT_REPOSITORY https://github.com/lammps/lammps GIT_TAG ${LAMMPS_VERSION}) - FetchContent_GetProperties(lammps_download) - if(NOT lammps_download_POPULATED) - FetchContent_Populate(lammps_download) - set(LAMMPS_SOURCE_ROOT ${lammps_download_SOURCE_DIR}) - endif() + FetchContent_MakeAvailable(lammps_download) + set(LAMMPS_SOURCE_ROOT ${lammps_download_SOURCE_DIR}) endif() set(LAMMPS_HEADER_DIR ${LAMMPS_SOURCE_ROOT}/src) message(STATUS "LAMMPS_HEADER_DIR is ${LAMMPS_HEADER_DIR}")