include(vcpkg_common_functions)

vcpkg_download_distfile(ARCHIVE
    URLS "https://computing.llnl.gov/projects/sundials/download/cvode-5.0.0-dev.2.tar.gz"
    FILENAME "cvode-5.0.0-dev.2.tar.gz"
    SHA512 506a8f6502c18147150f6f133882d41dddf4d05ac892f9089020912bde44471d4305a9d911480481f54f8071ceaf7f1fa3b85a61d6d5612082afb94a07a4079a
)

vcpkg_extract_source_archive_ex(
    OUT_SOURCE_PATH SOURCE_PATH
    ARCHIVE ${ARCHIVE}
)

vcpkg_configure_cmake(
    SOURCE_PATH ${SOURCE_PATH}
    PREFER_NINJA # Disable this option if project cannot be built with Ninja
    NO_CHARSET_FLAG # automatic templates
    OPTIONS 
      -DBUILD_CVODE:BOOL=ON
BUILD_TESTING:BOOL=OFF
CUDA_ENABLE:BOOL=OFF
EXAMPLES_ENABLE_C:BOOL=OFF
EXAMPLES_ENABLE_CXX:BOOL=OFF
EXAMPLES_INSTALL:BOOL=OFF
F2003_INTERFACE_ENABLE:BOOL=OFF
F77_INTERFACE_ENABLE:BOOL=OFF
HYPRE_ENABLE:BOOL=ON
KLU_ENABLE:BOOL=OFF
LAPACK_ENABLE:BOOL=OFF
MPI_ENABLE:BOOL=OFF
OPENMP_DEVICE_ENABLE:BOOL=OFF
OPENMP_ENABLE:BOOL=OFF
PETSC_ENABLE:BOOL=OFF
PTHREAD_ENABLE:BOOL=OFF
RAJA_ENABLE:BOOL=OFF
SUNDIALS_INDEX_SIZE:STRING=64
SUNDIALS_PRECISION:STRING=double
SUPERLUDIST_ENABLE:BOOL=OFF
SUPERLUMT_ENABLE:BOOL=OFF
Trilinos_ENABLE:BOOL=OFF
USE_XSDK_DEFAULTS:BOOL=OFF
)

vcpkg_install_cmake()

set(VCPKG_POLICY_EMPTY_PACKAGE enabled) # automatic templates
vcpkg_copy_pdbs() # automatic templates
configure_file(${SOURCE_PATH}/LICENSE ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
###
