Work on debian packaging.

This commit is contained in:
BadQuanta
2026-05-17 11:21:41 +00:00
parent 002b28f8d2
commit b92bf271e4
17 changed files with 1465 additions and 26 deletions
+46 -7
View File
@@ -7,20 +7,57 @@ project(hdk
option(HDK_TESTS "Build HDK tests" OFF)
option(HDK_EXAMPLES "Build HDK examples" OFF)
option(HDK_INSTALL_EXAMPLES "Install HDK example binaries and assets" OFF)
option(HDK_COVERAGE "Enable HDK coverage instrumentation and reporting" OFF)
option(HDK_USE_SYSTEM_DEPS "Prefer system packages before FetchContent fallbacks" ON)
set(HDK_COVERAGE_FAIL_UNDER 90 CACHE STRING "Minimum line coverage percentage required by strict coverage target")
set(HDK_DOCTEST_MIN_VERSION "2.4.12" CACHE STRING "Minimum doctest version when resolving system packages")
set(HDK_GRID_MIN_VERSION "0.0.1" CACHE STRING "Minimum hdk-grid version when resolving system packages")
set(HDK_SDL_MIN_VERSION "0.0.1" CACHE STRING "Minimum hdk-sdl version when resolving system packages")
set(HDK_IS3R_MIN_VERSION "0.0.1" CACHE STRING "Minimum hdk-is3r version when resolving system packages")
set(HDK_SDL3_MIN_VERSION "3.4.8" CACHE STRING "Minimum SDL3 version when resolving system packages")
set(HDK_GRID_GIT_REPOSITORY "https://git.ufp.institute/ufp/hdk-grid.git" CACHE STRING "Git repository used to fetch hdk-grid when package resolution fails")
set(HDK_GRID_GIT_TAG "v${HDK_GRID_MIN_VERSION}" CACHE STRING "Git tag used to fetch hdk-grid fallback")
set(HDK_SDL_GIT_REPOSITORY "https://git.ufp.institute/ufp/hdk-sdl.git" CACHE STRING "Git repository used to fetch hdk-sdl when package resolution fails")
set(HDK_SDL_GIT_TAG "v${HDK_SDL_MIN_VERSION}" CACHE STRING "Git tag used to fetch hdk-sdl fallback")
set(HDK_IS3R_GIT_REPOSITORY "https://git.ufp.institute/ufp/hdk-is3r.git" CACHE STRING "Git repository used to fetch hdk-is3r when package resolution fails")
set(HDK_IS3R_GIT_TAG "v${HDK_IS3R_MIN_VERSION}" CACHE STRING "Git tag used to fetch hdk-is3r fallback")
set(HDK_ASSETS_MIN_VERSION "0.0.1" CACHE STRING "Minimum hdk-assets version required by examples")
set(HDK_ASSETS_GIT_REPOSITORY "https://git.ufp.institute/ufp/hdk-assets.git" CACHE STRING "Git repository used to fetch hdk-assets when package resolution fails")
set(HDK_INSTALL_ASSETSDIR "assets" CACHE STRING "Install-time subdirectory for shared HDK assets under CMAKE_INSTALL_PREFIX")
set(HDK_CMAKE_POLICY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake" CACHE PATH "Directory containing shared HDK CMake policy helpers")
if(HDK_TESTS)
include(CTest)
enable_testing()
include(FetchContent)
FetchContent_Declare(
doctest
GIT_REPOSITORY https://github.com/doctest/doctest.git
GIT_TAG v2.4.12
)
FetchContent_MakeAvailable(doctest)
option(HDK_USE_SYSTEM_DOCTEST "Try system doctest before FetchContent fallback" ${HDK_USE_SYSTEM_DEPS})
option(HDK_FETCH_DOCTEST_FALLBACK "Fetch doctest when a suitable system package is unavailable" ON)
if(HDK_USE_SYSTEM_DOCTEST)
find_package(doctest ${HDK_DOCTEST_MIN_VERSION} QUIET CONFIG)
if(doctest_FOUND AND NOT TARGET doctest::doctest)
if(TARGET doctest)
add_library(doctest::doctest ALIAS doctest)
else()
set(doctest_FOUND FALSE)
endif()
endif()
endif()
if(NOT doctest_FOUND)
if(NOT HDK_FETCH_DOCTEST_FALLBACK)
message(FATAL_ERROR "doctest >= ${HDK_DOCTEST_MIN_VERSION} not found and HDK_FETCH_DOCTEST_FALLBACK=OFF")
endif()
include(FetchContent)
FetchContent_Declare(
doctest
GIT_REPOSITORY https://github.com/doctest/doctest.git
GIT_TAG v${HDK_DOCTEST_MIN_VERSION}
)
FetchContent_MakeAvailable(doctest)
endif()
endif()
if(HDK_COVERAGE)
@@ -47,6 +84,7 @@ endif()
add_subdirectory(grid)
add_subdirectory(sdl)
add_subdirectory(is3r)
add_subdirectory(assets)
#add_subdirectory(hogl)
if(HDK_TESTS AND HDK_COVERAGE)
@@ -121,3 +159,4 @@ if(HDK_DOCS)
message(WARNING "Doxygen not found, API documentation will not be generated.")
endif()
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/HDKPackaging.cmake)