if(NOT $ENV{CPM_SOURCE_CACHE})
    set(ENV{CPM_SOURCE_CACHE} $ENV{HOME}/.cache/CPM)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/CPM.cmake)
CPMUsePackageLock(${CMAKE_CURRENT_LIST_DIR}/../package-lock.cmake)
function(UsingRepo PACKAGE GIT)
    if(CPM_LOCAL_WORKSPACE AND EXISTS ${CPM_LOCAL_WORKSPACE}/${PACKAGE}/CMakeLists.txt)
        set(CPM_${PACKAGE}_SOURCE ${CPM_LOCAL_WORKSPACE}/${PACKAGE})
        message("Include package ${PACKAGE} with local repo: ${CPM_LOCAL_WORKSPACE}/${PACKAGE}")
    endif()
    CPMAddPackage(${GIT})
endfunction()