Current status of SDL.
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
# Bundled SDL3 static library targets
|
||||
# This file defines SDL3::SDL3 as an IMPORTED STATIC target pointing to the bundled
|
||||
# SDL3 static library. This allows consumers of hdk-sdl to link against the bundled
|
||||
# SDL3 without requiring system SDL3 to be installed.
|
||||
|
||||
# Compute the install prefix from this file's location
|
||||
get_filename_component(_sdl3_install_prefix "${CMAKE_CURRENT_LIST_DIR}/../../.." ABSOLUTE)
|
||||
|
||||
macro(set_and_check _var _file)
|
||||
set(${_var} "${_file}")
|
||||
if(NOT EXISTS "${_file}")
|
||||
message(FATAL_ERROR "File or directory ${_var}=${_file} referenced by hdk-sdlBundledSDL3Targets does not exist!")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# Validate the bundled SDL3 static library
|
||||
set_and_check(_sdl3_lib_path "${_sdl3_install_prefix}/lib/cmake/hdk-sdl/sdl3-static/libSDL3.a")
|
||||
|
||||
# Define SDL3::SDL3 as IMPORTED STATIC target
|
||||
if(NOT TARGET SDL3::SDL3)
|
||||
add_library(SDL3::SDL3 STATIC IMPORTED GLOBAL)
|
||||
set_target_properties(SDL3::SDL3 PROPERTIES
|
||||
IMPORTED_LOCATION "${_sdl3_lib_path}"
|
||||
VERSION "3.4.8"
|
||||
)
|
||||
# SDL3 is a static library; link dependencies would go here if needed
|
||||
# For now, SDL3 is self-contained in the .a file
|
||||
endif()
|
||||
|
||||
# Optionally define SDL3::SDL3-static as an alias for clarity
|
||||
if(NOT TARGET SDL3::SDL3-static)
|
||||
add_library(SDL3::SDL3-static ALIAS SDL3::SDL3)
|
||||
endif()
|
||||
|
||||
unset(_sdl3_install_prefix)
|
||||
unset(_sdl3_lib_path)
|
||||
@@ -0,0 +1,18 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(hdk-grid)
|
||||
|
||||
# Include bundled SDL3 targets (defines SDL3::SDL3)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/hdk-sdlBundledSDL3Targets.cmake")
|
||||
|
||||
if(NOT TARGET hdk::hdk-sdl)
|
||||
set_and_check(_hdk_sdl_include_dir "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
|
||||
add_library(hdk::hdk-sdl INTERFACE IMPORTED)
|
||||
set_target_properties(hdk::hdk-sdl PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::SDL3;hdk::hdk-grid"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_hdk_sdl_include_dir}"
|
||||
)
|
||||
endif()
|
||||
|
||||
check_required_components(hdk-sdl)
|
||||
@@ -0,0 +1,16 @@
|
||||
@PACKAGE_INIT@
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
find_dependency(SDL3)
|
||||
find_dependency(hdk-grid)
|
||||
|
||||
if(NOT TARGET hdk::hdk-sdl)
|
||||
set_and_check(_hdk_sdl_include_dir "@PACKAGE_CMAKE_INSTALL_INCLUDEDIR@")
|
||||
add_library(hdk::hdk-sdl INTERFACE IMPORTED)
|
||||
set_target_properties(hdk::hdk-sdl PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "SDL3::SDL3;hdk::hdk-grid"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_hdk_sdl_include_dir}"
|
||||
)
|
||||
endif()
|
||||
|
||||
check_required_components(hdk-sdl)
|
||||
Reference in New Issue
Block a user