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
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions source/lmp/plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION)
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}")
Expand Down Expand Up @@ -77,7 +74,7 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION)
target_precompile_headers(${libname} PUBLIC [["deepmd.hpp"]])
remove_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI})
if("$ENV{CIBUILDWHEEL}" STREQUAL "1" OR "$ENV{LMP_CXX11_ABI_0}" STREQUAL
"1")
"1")
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
endif()
else()
Expand All @@ -96,7 +93,7 @@ if(DEFINED LAMMPS_SOURCE_ROOT OR DEFINED LAMMPS_VERSION)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
set_target_properties(${libname} PROPERTIES LINK_FLAGS
"-Wl,-undefined,dynamic_lookup")
"-Wl,-undefined,dynamic_lookup")
else()
set_target_properties(
${libname} PROPERTIES INSTALL_RPATH "$ORIGIN;${BACKEND_LIBRARY_PATH}"
Expand Down
Loading