cmake: declutter root + remove obsolete variables
parent
39a7abad7a
commit
653893f188
|
@ -22,7 +22,7 @@ indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
[{cmake_uninstall.cmake.in,test/CMakeLists.txt,./SDL3Config.cmake.in}]
|
[{cmake/cmake_uninstall.cmake.in,test/CMakeLists.txt,cmake/SDL3Config.cmake.in}]
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
indent_style = space
|
indent_style = space
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
|
|
@ -2915,34 +2915,15 @@ else()
|
||||||
set(sdl_static_libname "SDL3")
|
set(sdl_static_libname "SDL3")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(prefix ${CMAKE_INSTALL_PREFIX})
|
|
||||||
file(RELATIVE_PATH bin_prefix_relpath "${CMAKE_INSTALL_FULL_BINDIR}" "${CMAKE_INSTALL_PREFIX}")
|
|
||||||
|
|
||||||
set(exec_prefix "\${prefix}")
|
|
||||||
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
|
|
||||||
set(bindir "\${exec_prefix}/${CMAKE_INSTALL_BINDIR}")
|
|
||||||
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
|
|
||||||
if(SDL_STATIC)
|
|
||||||
set(ENABLE_STATIC_TRUE "")
|
|
||||||
set(ENABLE_STATIC_FALSE "#")
|
|
||||||
else()
|
|
||||||
set(ENABLE_STATIC_TRUE "#")
|
|
||||||
set(ENABLE_STATIC_FALSE "")
|
|
||||||
endif()
|
|
||||||
if(SDL_SHARED)
|
if(SDL_SHARED)
|
||||||
set(PKGCONFIG_LIBS_PRIV "
|
set(PKGCONFIG_LIBS_PRIV "\nLibs.private:")
|
||||||
Libs.private:")
|
|
||||||
set(ENABLE_SHARED_TRUE "")
|
|
||||||
set(ENABLE_SHARED_FALSE "#")
|
|
||||||
else()
|
else()
|
||||||
set(PKGCONFIG_LIBS_PRIV "")
|
set(PKGCONFIG_LIBS_PRIV "")
|
||||||
set(ENABLE_SHARED_TRUE "#")
|
|
||||||
set(ENABLE_SHARED_FALSE "")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Clean up the different lists
|
# Clean up the different lists
|
||||||
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
listtostr(EXTRA_LIBS _EXTRA_LIBS "-l")
|
||||||
set(SDL_STATIC_LIBS ${SDL_LIBS} ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
set(SDL_STATIC_LIBS ${EXTRA_LDFLAGS} ${_EXTRA_LIBS})
|
||||||
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
list(REMOVE_DUPLICATES SDL_STATIC_LIBS)
|
||||||
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
listtostr(SDL_STATIC_LIBS _SDL_STATIC_LIBS)
|
||||||
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
set(SDL_STATIC_LIBS ${_SDL_STATIC_LIBS})
|
||||||
|
@ -2962,8 +2943,7 @@ endif()
|
||||||
# MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}")
|
# MESSAGE(STATUS "SDL_LIBS: ${SDL_LIBS}")
|
||||||
# MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}")
|
# MESSAGE(STATUS "SDL_STATIC_LIBS: ${SDL_STATIC_LIBS}")
|
||||||
|
|
||||||
configure_file("${SDL3_SOURCE_DIR}/sdl3.pc.in"
|
configure_file(cmake/sdl3.pc.in sdl3.pc @ONLY)
|
||||||
"${SDL3_BINARY_DIR}/sdl3.pc" @ONLY)
|
|
||||||
|
|
||||||
macro(check_add_debug_flag FLAG SUFFIX)
|
macro(check_add_debug_flag FLAG SUFFIX)
|
||||||
check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX})
|
check_c_compiler_flag(${FLAG} HAS_C_FLAG_${SUFFIX})
|
||||||
|
@ -3299,7 +3279,7 @@ if(NOT SDL3_DISABLE_INSTALL)
|
||||||
##### Export files #####
|
##### Export files #####
|
||||||
|
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
configure_package_config_file(SDL3Config.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/SDL3Config.cmake"
|
configure_package_config_file(cmake/SDL3Config.cmake.in SDL3Config.cmake
|
||||||
PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_FULL_BINDIR CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR
|
PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_FULL_BINDIR CMAKE_INSTALL_FULL_INCLUDEDIR CMAKE_INSTALL_FULL_LIBDIR
|
||||||
INSTALL_DESTINATION "${SDL_INSTALL_CMAKEDIR}"
|
INSTALL_DESTINATION "${SDL_INSTALL_CMAKEDIR}"
|
||||||
)
|
)
|
||||||
|
@ -3373,13 +3353,10 @@ endif()
|
||||||
|
|
||||||
if(NOT SDL3_DISABLE_UNINSTALL)
|
if(NOT SDL3_DISABLE_UNINSTALL)
|
||||||
if(NOT TARGET uninstall)
|
if(NOT TARGET uninstall)
|
||||||
configure_file(
|
configure_file(cmake/cmake_uninstall.cmake.in cmake_uninstall.cmake IMMEDIATE @ONLY)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
|
||||||
IMMEDIATE @ONLY)
|
|
||||||
|
|
||||||
add_custom_target(uninstall
|
add_custom_target(uninstall
|
||||||
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)
|
COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
if (NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
||||||
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
|
message(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"")
|
||||||
endif(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt")
|
endif()
|
||||||
|
|
||||||
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
file(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files)
|
||||||
string(REGEX REPLACE "\n" ";" files "${files}")
|
string(REGEX REPLACE "\n" ";" files "${files}")
|
||||||
foreach (file ${files})
|
foreach(file ${files})
|
||||||
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
message(STATUS "Uninstalling \"$ENV{DESTDIR}${file}\"")
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
COMMAND @CMAKE_COMMAND@ -E remove "$ENV{DESTDIR}${file}"
|
||||||
|
@ -14,5 +14,4 @@ foreach (file ${files})
|
||||||
if(NOT ${rm_retval} EQUAL 0)
|
if(NOT ${rm_retval} EQUAL 0)
|
||||||
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
message(FATAL_ERROR "Problem when removing \"$ENV{DESTDIR}${file}\"")
|
||||||
endif (NOT ${rm_retval} EQUAL 0)
|
endif (NOT ${rm_retval} EQUAL 0)
|
||||||
endforeach(file)
|
endforeach()
|
||||||
|
|
|
@ -68,19 +68,22 @@ macro(message_tested_option _NAME)
|
||||||
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
message(STATUS " ${_NAME}${_PAD}(Wanted: ${_REQVALUE}): ${HAVE_${_STRIPPEDNAME}}")
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
macro(listtostr _LIST _OUTPUT)
|
function(listtostr LIST OUTPUT)
|
||||||
if(${ARGC} EQUAL 3)
|
if(${ARGC} EQUAL 3)
|
||||||
# prefix for each element
|
# prefix for each element
|
||||||
set(_LPREFIX ${ARGV2})
|
set(LPREFIX ${ARGV2})
|
||||||
else()
|
else()
|
||||||
set(_LPREFIX "")
|
set(LPREFIX "")
|
||||||
endif()
|
endif()
|
||||||
# Do not use string(REPLACE ";" " ") here to avoid messing up list
|
# Do not use string(REPLACE ";" " ") here to avoid messing up list entries
|
||||||
# entries
|
set(res)
|
||||||
foreach(_ITEM ${${_LIST}})
|
foreach(ITEM ${${LIST}})
|
||||||
set(${_OUTPUT} "${${_OUTPUT}} ${_LPREFIX}${_ITEM}")
|
if(ITEM)
|
||||||
|
set(res "${res} ${LPREFIX}${ITEM}")
|
||||||
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
set(${OUTPUT} "${res}" PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(listtostrrev _LIST _OUTPUT)
|
function(listtostrrev _LIST _OUTPUT)
|
||||||
if(${ARGC} EQUAL 3)
|
if(${ARGC} EQUAL 3)
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
# sdl pkg-config source file
|
# sdl pkg-config source file
|
||||||
|
|
||||||
prefix=@prefix@
|
prefix=@CMAKE_INSTALL_PREFIX@
|
||||||
exec_prefix=@exec_prefix@
|
exec_prefix=${prefix}
|
||||||
libdir=@libdir@
|
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
|
||||||
includedir=@includedir@
|
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
|
||||||
|
|
||||||
Name: sdl3
|
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.
|
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.
|
Loading…
Reference in New Issue