cmake: declutter root + remove obsolete variables
This commit is contained in:
committed by
Sam Lantinga
parent
39a7abad7a
commit
653893f188
64
cmake/SDL3Config.cmake.in
Normal file
64
cmake/SDL3Config.cmake.in
Normal file
@@ -0,0 +1,64 @@
|
||||
# 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)
|
||||
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3Targets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SDL3Targets.cmake")
|
||||
set(SDL3_SDL3_FOUND TRUE)
|
||||
endif()
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake")
|
||||
if(ANDROID)
|
||||
enable_language(CXX)
|
||||
endif()
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SDL3staticTargets.cmake")
|
||||
set(SDL3_SDL3-static_FOUND TRUE)
|
||||
endif()
|
||||
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/SDL3testTargets.cmake")
|
||||
set(SDL3_SDL3_test_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/sdlfind.cmake")
|
||||
|
||||
set(SDL_ALSA @SDL_ALSA@)
|
||||
set(SDL_ALSA_SHARED @SDL_ALSA_SHARED@)
|
||||
if(SDL_ALSA AND NOT SDL_ALSA_SHARED AND TARGET SDL3::SDL3-static)
|
||||
sdlFindALSA()
|
||||
endif()
|
||||
unset(SDL_ALSA)
|
||||
unset(SDL_ALSA_SHARED)
|
||||
|
||||
check_required_components(SDL3)
|
||||
|
||||
# Create SDL3::SDL3 alias for static-only builds
|
||||
if(TARGET SDL3::SDL3-static AND NOT TARGET SDL3::SDL3)
|
||||
if(CMAKE_VERSION VERSION_LESS "3.18")
|
||||
# FIXME: Aliasing local targets is not supported on CMake < 3.18, so make it global.
|
||||
add_library(SDL3::SDL3 INTERFACE IMPORTED)
|
||||
set_target_properties(SDL3::SDL3 PROPERTIES INTERFACE_LINK_LIBRARIES "SDL3::SDL3-static")
|
||||
else()
|
||||
add_library(SDL3::SDL3 ALIAS SDL3::SDL3-static)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# For compatibility with autotools sdl3-config.cmake, provide SDL3_* variables.
|
||||
|
||||
set(SDL3_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
|
||||
set(SDL3_EXEC_PREFIX "@PACKAGE_CMAKE_INSTALL_PREFIX@")
|
||||
set(SDL3_INCLUDE_DIR "@PACKAGE_CMAKE_INSTALL_FULL_INCLUDEDIR@")
|
||||
set(SDL3_INCLUDE_DIRS "${SDL3_INCLUDE_DIR}")
|
||||
set(SDL3_BINDIR "@PACKAGE_CMAKE_INSTALL_FULL_BINDIR@")
|
||||
set(SDL3_LIBDIR "@PACKAGE_CMAKE_INSTALL_FULL_LIBDIR@")
|
||||
set(SDL3_LIBRARIES SDL3::SDL3)
|
||||
set(SDL3_STATIC_LIBRARIES SDL3::SDL3-static)
|
||||
set(SDL3_STATIC_PRIVATE_LIBS)
|
||||
|
||||
set(SDL3TEST_LIBRARY SDL3::SDL3_test)
|
||||
17
cmake/cmake_uninstall.cmake.in
Normal file
17
cmake/cmake_uninstall.cmake.in
Normal file
@@ -0,0 +1,17 @@
|
||||
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
|
||||
endif()
|
||||
|
||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||
foreach(file ${files})
|
||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||
execute_process(
|
||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
||||
OUTPUT_VARIABLE rm_out
|
||||
RESULT_VARIABLE rm_retval
|
||||
)
|
||||
if(NOT ${rm_retval} EQUAL 0)
|
||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||
endif (NOT ${rm_retval} EQUAL 0)
|
||||
endforeach()
|
||||
@@ -68,19 +68,22 @@ macro(message_tested_option _NAME)
|
||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||
endmacro()
|
||||
|
||||
macro(listtostr _LIST _OUTPUT)
|
||||
function(listtostr LIST OUTPUT)
|
||||
if(${ARGC} EQUAL 3)
|
||||
# prefix for each element
|
||||
set(_LPREFIX ${ARGV2})
|
||||
set(LPREFIX ${ARGV2})
|
||||
else()
|
||||
set(_LPREFIX "")
|
||||
set(LPREFIX "")
|
||||
endif()
|
||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list
|
||||
# entries
|
||||
foreach(_ITEM ${${_LIST}})
|
||||
set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}")
|
||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list entries
|
||||
set(res)
|
||||
foreach(ITEM ${${LIST}})
|
||||
if(ITEM)
|
||||
set(res "${res} ${LPREFIX}${ITEM}")
|
||||
endif()
|
||||
endforeach()
|
||||
endmacro()
|
||||
set(${OUTPUT} "${res}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
function(listtostrrev _LIST _OUTPUT)
|
||||
if(${ARGC} EQUAL 3)
|
||||
|
||||
14
cmake/sdl3.pc.in
Normal file
14
cmake/sdl3.pc.in
Normal file
@@ -0,0 +1,14 @@
|
||||
# sdl pkg-config source file
|
||||
|
||||
prefix=@CMAKE_INSTALL_PREFIX@
|
||||
exec_prefix=${prefix}
|
||||
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||
|
||||
Name: sdl3
|
||||
Description: Simple DirectMedia Layer is a cross-platform multimedia library designed to provide low level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D video framebuffer.
|
||||
Version: @SDL_VERSION@
|
||||
Requires.private: @PKGCONFIG_DEPENDS@
|
||||
Conflicts:
|
||||
Libs: -L${libdir} @SDL_RLD_FLAGS@ @SDL_LIBS@ @PKGCONFIG_LIBS_PRIV@ @SDL_STATIC_LIBS@
|
||||
Cflags: -I${includedir} @SDL_CFLAGS@
|
||||
Reference in New Issue
Block a user