Skip to content

Commit 151a3c6

Browse files
authored
[cmake] use shallow clone for FetchContent'ing libxc (#42)
* [cmake] use shallow clone for FetchContent'ing libxc * introduce `FETCHCONTENT_LIBXC_GIT_SHALLOW` CMake CACHE variable `FETCHCONTENT_LIBXC_GIT_SHALLOW` controls whether to use shallow clone of libxc, `ON` by default.
1 parent f932a1b commit 151a3c6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ if( ${Libxc_FOUND} )
6868

6969
else()
7070

71+
option( FETCHCONTENT_LIBXC_GIT_SHALLOW "Whether to use GIT_SHALLOW for FetchContent'ing libxc" ON )
72+
7173
FetchContent_Declare(
7274
libxc
7375
GIT_REPOSITORY https://gitlab.com/libxc/libxc.git
76+
# if pinning to specific SHA change the FETCHCONTENT_LIBXC_GIT_SHALLOW default to OFF, https://cmake.org/cmake/help/latest/module/ExternalProject.html#git
7477
GIT_TAG 7.0.0
78+
GIT_SHALLOW ${FETCHCONTENT_LIBXC_GIT_SHALLOW}
7579
PATCH_COMMAND sed -i -e "s/p->info->family != XC_KINETIC/p->info->kind != XC_KINETIC/g" src/work_mgga_inc.c
7680
)
7781
set( Libxc_VERSION 7.0.0 )

0 commit comments

Comments
 (0)