Files
Build-System/cmake/VoidDependency.cmake
T
faumaray 3cac890ce9 bootstrap
Signed-off-by: faumaray <faumaray@gmail.com>
2026-11-25 01:32:43 +03:00

31 lines
1.3 KiB
CMake

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()