-
Notifications
You must be signed in to change notification settings - Fork 10
/
fetch_mrcpp.cmake
36 lines (30 loc) · 1.08 KB
/
fetch_mrcpp.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# We save CMAKE_BUILD_TYPE, as we will set it to Release for externals
set(_build_type ${CMAKE_BUILD_TYPE})
set(CMAKE_BUILD_TYPE Release)
find_package(MRCPP 1.5 CONFIG QUIET)
# whether MRCPP was fetched and built locally
set(MRCPP_FETCHED FALSE)
if(TARGET MRCPP::mrcpp)
get_property(_loc TARGET MRCPP::mrcpp PROPERTY LOCATION)
message(STATUS "Found MRCPP: ${_loc} (found version ${MRCPP_VERSION})")
else()
message(STATUS "Suitable MRCPP could not be located. Fetching and building!")
include(FetchContent)
FetchContent_Declare(mrcpp
QUIET
GIT_REPOSITORY
https://github.com/MRChemSoft/mrcpp.git
GIT_TAG
8107aabe28d6e75f04d66c95a94c157731484eae
)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER})
# Always build with OpenMP and without MPI
set(ENABLE_OPENMP TRUE CACHE BOOL "")
set(ENABLE_MPI FALSE CACHE BOOL "")
set(ENABLE_TESTS FALSE CACHE BOOL "")
set(ENABLE_EXAMPLES FALSE CACHE BOOL "")
FetchContent_MakeAvailable(mrcpp)
set(MRCPP_FETCHED TRUE)
endif()
# reset CMAKE_BUILD_TYPE to whatever it was for VAMPyR
set(CMAKE_BUILD_TYPE ${_build_type})