include(FetchContent) function(vbs_add_void_dependency) # Function scope keeps dependency policy out of the embedding project's variables/cache. set(VOID_ENABLE_TESTING OFF) set(VOID_ENABLE_BENCHMARKS OFF) set(BUILD_SHARED_LIBS OFF) set(VOID_ENABLED_MODULES Configuration) if(VBS_BUILD_TESTS) list(APPEND VOID_ENABLED_MODULES Testing) endif() if(VBS_VOID_SOURCE_DIR) get_filename_component(_vbs_void_source "${VBS_VOID_SOURCE_DIR}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") if(NOT IS_DIRECTORY "${_vbs_void_source}" OR NOT EXISTS "${_vbs_void_source}/CMakeLists.txt") message(FATAL_ERROR "VBS_VOID_SOURCE_DIR must contain a VoidLibrary CMakeLists.txt") endif() message(STATUS "VBS development source override: ${_vbs_void_source}; " "the pinned VoidLibrary revision ${VBS_VOID_REVISION} is bypassed") FetchContent_Declare(voidlibrary SOURCE_DIR "${_vbs_void_source}") else() FetchContent_Declare(voidlibrary GIT_REPOSITORY https://git.faumaray.com/Void/VoidLibrary.git GIT_TAG "${VBS_VOID_REVISION}" GIT_SHALLOW FALSE) endif() FetchContent_MakeAvailable(voidlibrary) set(VBS_VOID_TESTING_SCRIPT "${voidlibrary_SOURCE_DIR}/cmake/VoidTesting.cmake" PARENT_SCOPE) endfunction()