From b3258af5ec15a0a254026f0a4c4df5dbc5c2745e Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Thu, 6 Mar 2025 12:24:44 -0500 Subject: [PATCH 1/2] [cmake] use shallow clone for FetchContent'ing libxc --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d7d41c8..80160d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,7 @@ else() libxc GIT_REPOSITORY https://gitlab.com/libxc/libxc.git GIT_TAG 7.0.0 + GIT_SHALLOW 1 PATCH_COMMAND sed -i -e "s/p->info->family != XC_KINETIC/p->info->kind != XC_KINETIC/g" src/work_mgga_inc.c ) set( Libxc_VERSION 7.0.0 ) From 055f097e9d6e850b9f4f2583e98b90dd827b6e99 Mon Sep 17 00:00:00 2001 From: Eduard Valeyev Date: Mon, 31 Mar 2025 10:37:34 -0400 Subject: [PATCH 2/2] introduce `FETCHCONTENT_LIBXC_GIT_SHALLOW` CMake CACHE variable `FETCHCONTENT_LIBXC_GIT_SHALLOW` controls whether to use shallow clone of libxc, `ON` by default. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80160d7..2b492f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,14 @@ if( ${Libxc_FOUND} ) else() + option( FETCHCONTENT_LIBXC_GIT_SHALLOW "Whether to use GIT_SHALLOW for FetchContent'ing libxc" ON ) + FetchContent_Declare( libxc GIT_REPOSITORY https://gitlab.com/libxc/libxc.git + # if pinning to specific SHA change the FETCHCONTENT_LIBXC_GIT_SHALLOW default to OFF, https://cmake.org/cmake/help/latest/module/ExternalProject.html#git GIT_TAG 7.0.0 - GIT_SHALLOW 1 + GIT_SHALLOW ${FETCHCONTENT_LIBXC_GIT_SHALLOW} PATCH_COMMAND sed -i -e "s/p->info->family != XC_KINETIC/p->info->kind != XC_KINETIC/g" src/work_mgga_inc.c ) set( Libxc_VERSION 7.0.0 )