2022-11-22 07:28:58 +03:00
|
|
|
# SDL cmake project-config input for CMakeLists.txt script
|
|
|
|
|
|
|
|
include(FeatureSummary)
|
|
|
|
set_package_properties(SDL3 PROPERTIES
|
|
|
|
URL "https://www.libsdl.org/"
|
|
|
|
DESCRIPTION "low level access to audio, keyboard, mouse, joystick, and graphics hardware"
|
|
|
|
)
|
|
|
|
|
|
|
|
@PACKAGE_INIT@
|
|
|
|
|
|
|
|
set(SDL3_FOUND TRUE)
|
2023-01-21 03:08:32 +03:00
|
|
|
set(_sdl3_framework @SDL_FRAMEWORK@)
|
2022-11-22 07:28:58 +03:00
|
|
|
|
2023-01-22 02:01:52 +03:00
|
|
|
# Find SDL3::Headers
|
|
|
|
if(NOT TARGET SDL3::Headers)
|
2023-01-21 02:55:44 +03:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SDL3headersTargets.cmake")
|
2024-04-01 21:09:51 +03:00
|
|
|
if(NOT CMAKE_VERSION VERSION_LESS "3.25")
|
|
|
|
set_property(TARGET SDL3::Headers PROPERTY SYSTEM 0)
|
|
|
|
endif()
|
2023-01-21 02:55:44 +03:00
|
|
|
endif()
|
2023-01-22 02:01:52 +03:00
|
|
|
set(SDL3_Headers_FOUND TRUE)
|
2023-01-21 02:55:44 +03:00
|
|
|
|
2023-02-17 01:30:20 +03:00
|
|
|
# Find SDL3::SDL3-shared
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3sharedTargets.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SDL3sharedTargets.cmake")
|
|
|
|
set(SDL3_SDL3-shared_FOUND TRUE)
|
2022-11-22 07:28:58 +03:00
|
|
|
endif()
|
2023-01-21 03:08:32 +03:00
|
|
|
|
2023-02-28 06:20:30 +03:00
|
|
|
macro(find_sdl3_static_dependencies)
|
|
|
|
@SDL_FIND_PKG_CONFIG_COMMANDS@
|
|
|
|
endmacro()
|
|
|
|
|
2023-01-21 03:08:32 +03:00
|
|
|
# Find SDL3::SDL3-static
|
|
|
|
if(_sdl3_framework)
|
2023-02-28 06:20:30 +03:00
|
|
|
set(SDL3_SDL3-static_FOUND TRUE)
|
|
|
|
find_sdl3_static_dependencies()
|
2023-01-21 03:08:32 +03:00
|
|
|
find_package(SDL3-static CONFIG)
|
2023-02-28 06:20:30 +03:00
|
|
|
if(SDL3_SDL3-static_FOUND AND SDL3-static_FOUND)
|
2023-01-21 03:08:32 +03:00
|
|
|
set(SDL3_SDL3-static_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake")
|
|
|
|
set(SDL3_SDL3-static_FOUND TRUE)
|
2023-02-28 06:20:30 +03:00
|
|
|
find_sdl3_static_dependencies()
|
|
|
|
if(SDL3_SDL3-static_FOUND)
|
|
|
|
if(ANDROID OR HAIKU)
|
|
|
|
enable_language(CXX)
|
|
|
|
endif()
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake")
|
|
|
|
endif()
|
2022-11-22 07:28:58 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
2023-01-21 03:08:32 +03:00
|
|
|
|
2023-11-23 01:28:39 +03:00
|
|
|
if(ANDROID AND EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3jarTargets.cmake")
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SDL3jarTargets.cmake")
|
|
|
|
set(SDL3_Jar_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
|
2023-02-17 01:30:20 +03:00
|
|
|
if(SDL3_SDL3-shared_FOUND OR SDL3_SDL3-static_FOUND)
|
|
|
|
set(SDL3_SDL3_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
|
2023-01-21 03:08:32 +03:00
|
|
|
# Find SDL3::SDL3_test
|
|
|
|
if(_sdl3_framework)
|
|
|
|
find_package(SDL3_test CONFIG)
|
|
|
|
if(SDL3_test_FOUND)
|
|
|
|
enable_language(OBJC)
|
|
|
|
set(SDL3_SDL3_test_FOUND TRUE)
|
|
|
|
endif()
|
|
|
|
else()
|
|
|
|
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake")
|
|
|
|
set(SDL3_SDL3_test_FOUND TRUE)
|
2023-02-28 06:20:30 +03:00
|
|
|
@SDL_TEST_FIND_PKG_CONFIG_COMMANDS@
|
|
|
|
if(SDL3_SDL3_test_FOUND)
|
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake")
|
|
|
|
endif()
|
2023-01-21 03:08:32 +03:00
|
|
|
endif()
|
2022-11-22 07:28:58 +03:00
|
|
|
endif()
|
|
|
|
|
|
|
|
check_required_components(SDL3)
|
|
|
|
|
2023-02-17 01:30:20 +03:00
|
|
|
function(_sdl_create_target_alias_compat NEW_TARGET TARGET)
|
2022-11-22 07:28:58 +03:00
|
|
|
if(CMAKE_VERSION VERSION_LESS "3.18")
|
2023-02-20 02:43:53 +03:00
|
|
|
# Aliasing local targets is not supported on CMake < 3.18, so make it global.
|
2023-02-17 01:30:20 +03:00
|
|
|
add_library(${NEW_TARGET} INTERFACE IMPORTED)
|
|
|
|
set_target_properties(${NEW_TARGET} PROPERTIES INTERFACE_LINK_LIBRARIES "${TARGET}")
|
|
|
|
else()
|
|
|
|
add_library(${NEW_TARGET} ALIAS ${TARGET})
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
# Make sure SDL3::SDL3 always exists
|
|
|
|
if(NOT TARGET SDL3::SDL3)
|
|
|
|
if(TARGET SDL3::SDL3-shared)
|
|
|
|
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-shared)
|
2022-11-22 07:28:58 +03:00
|
|
|
else()
|
2023-02-17 01:30:20 +03:00
|
|
|
_sdl_create_target_alias_compat(SDL3::SDL3 SDL3::SDL3-static)
|
2022-11-22 07:28:58 +03:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(SDL3_LIBRARIES SDL3::SDL3)
|
|
|
|
set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static)
|
|
|
|
set(SDL3_STATIC_PRIVATE_LIBS)
|
|
|
|
|
2022-11-28 20:54:09 +03:00
|
|
|
set(SDL3TEST_LIBRARY SDL3::SDL3_test)
|