if(H5PP_PACKAGE_MANAGER MATCHES "fetch")


    if(NOT CMAKE_CXX_STANDARD)
        set(CMAKE_CXX_STANDARD 17)
    endif()
    if(NOT CMAKE_CXX_STANDARD_REQUIRED)
        set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
    endif()
    if(NOT CMAKE_CXX_EXTENSIONS)
        set(CMAKE_CXX_EXTENSIONS FALSE)
    endif()


    if(H5PP_ENABLE_EIGEN3)
        if(NOT TARGET Eigen3::Eigen)
            include(cmake/fetch/FetchEigen3.cmake)
        endif()
        if(TARGET Eigen3::Eigen)
            target_link_libraries(deps INTERFACE Eigen3::Eigen)
        else()
            message(FATAL_ERROR "Failed FetchContent: Eigen3")
        endif()
    endif()

    if(H5PP_ENABLE_FMT)
        if(NOT TARGET fmt::fmt)
            include(cmake/fetch/Fetchfmt.cmake)
        endif()
        if(TARGET fmt::fmt)
            target_link_libraries(deps INTERFACE fmt::fmt)
        else()
            message(FATAL_ERROR "Failed FetchContent: fmt")
        endif()
    endif()

    if(H5PP_ENABLE_SPDLOG)
        if(NOT TARGET spdlog::spdlog)
            include(cmake/fetch/Fetchspdlog.cmake)
        endif()
        if(TARGET spdlog::spdlog)
            target_link_libraries(deps INTERFACE spdlog::spdlog)
        else()
            message(FATAL_ERROR "Failed FetchContent: spdlog")
        endif()
    endif()

    include(cmake/InstallHDF5.cmake)
    install_hdf5()
    target_link_libraries(deps INTERFACE ${PKG_hdf5_TARGET})
endif()