29 lines
1.3 KiB
CMake
29 lines
1.3 KiB
CMake
# DateToSpine is distributed as a source-complete offline project. Configuration
|
|
# must fail when a vendored dependency is missing; it must never fetch one.
|
|
set(FETCHCONTENT_FULLY_DISCONNECTED ON CACHE BOOL
|
|
"Never download dependencies while configuring DateToSpine" FORCE)
|
|
set(FETCHCONTENT_UPDATES_DISCONNECTED ON CACHE BOOL
|
|
"Never update dependencies while configuring DateToSpine" FORCE)
|
|
|
|
function(dts_require_vendored_spine version_line runtime_subdirectory)
|
|
set(version_root
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/third_party/spine-runtimes/${version_line}")
|
|
set(runtime_root "${version_root}/${runtime_subdirectory}")
|
|
foreach(required_file IN ITEMS
|
|
"${version_root}/LICENSE"
|
|
"${runtime_root}/include/spine/spine.h")
|
|
if(NOT EXISTS "${required_file}")
|
|
message(FATAL_ERROR
|
|
"Offline dependency is incomplete: ${required_file}\n"
|
|
"Restore the vendored files from the DateToSpine source package. "
|
|
"CMake will not download them.")
|
|
endif()
|
|
endforeach()
|
|
endfunction()
|
|
|
|
dts_require_vendored_spine("3.8" "spine-cpp/spine-cpp")
|
|
dts_require_vendored_spine("4.0" "spine-cpp/spine-cpp")
|
|
dts_require_vendored_spine("4.1" "spine-cpp/spine-cpp")
|
|
dts_require_vendored_spine("4.2" "spine-cpp/spine-cpp")
|
|
dts_require_vendored_spine("4.3" "spine-cpp")
|