Skip to content

Commit

Permalink
Build: won't download libxc on absent. (#1312)
Browse files Browse the repository at this point in the history
Libxc generates header files ad hoc, which might cause compilation errors.
Reverting #1173.
  • Loading branch information
caic99 committed Sep 26, 2022
1 parent def583c commit 8b1b1bb
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,23 +241,13 @@ if(DEFINED Libxc_DIR)
set(ENABLE_LIBXC ON)
endif()
if(ENABLE_LIBXC)
find_package(Libxc 5.1.7 HINTS ${Libxc_DIR}/share/cmake/Libxc)
find_package(Libxc 5.1.7 REQUIRED HINTS ${Libxc_DIR}/share/cmake/Libxc)
if(${Libxc_FOUND})
message(STATUS "Found Libxc: version "${Libxc_VERSION})
message(STATUS "Found Libxc: version " ${Libxc_VERSION})
target_link_libraries(${ABACUS_BIN_NAME} Libxc::xc)
include_directories(${Libxc_INCLUDE_DIRS})
else()
include(FetchContent)
FetchContent_Declare(
Libxc
GIT_REPOSITORY https://gitlab.com/libxc/libxc.git
GIT_TAG "5.2.3"
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
FetchContent_MakeAvailable(Libxc)
add_compile_definitions(USE_LIBXC)
endif()
add_compile_definitions(USE_LIBXC)
endif()

add_compile_definitions(
Expand Down

0 comments on commit 8b1b1bb

Please sign in to comment.