From 23c2c15a7036913eb22bf83d39a19fe74310ff69 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Sun, 22 Jan 2023 00:01:52 +0100 Subject: [PATCH] cmake: capitalize SDL3::Headers target --- CMakeLists.txt | 22 +++++++++---------- VisualC/pkg-support/cmake/sdl3-config.cmake | 10 ++++----- .../resources/CMake/sdl3-config.cmake | 10 ++++----- cmake/SDL3Config.cmake.in | 8 +++---- cmake/test/CMakeLists.txt | 4 ++-- 5 files changed, 27 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c22bf0288..99b8f7b28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3096,24 +3096,24 @@ if(SDL_FRAMEWORK) list(APPEND SOURCE_FILES ${SDL_FRAMEWORK_RESOURCES}) endif() -add_library(SDL3_headers INTERFACE) -add_library(SDL3::headers ALIAS SDL3_headers) -set_target_properties(SDL3_headers PROPERTIES - EXPORT_NAME "headers" +add_library(SDL3_Headers INTERFACE) +add_library(SDL3::Headers ALIAS SDL3_Headers) +set_target_properties(SDL3_Headers PROPERTIES + EXPORT_NAME "Headers" ) -target_include_directories(SDL3_headers +target_include_directories(SDL3_Headers INTERFACE "$" "$" "$" ) if(SDL_FRAMEWORK) - target_include_directories(SDL3_headers + target_include_directories(SDL3_Headers INTERFACE "$" ) else() - target_include_directories(SDL3_headers + target_include_directories(SDL3_Headers INTERFACE "$" "$" @@ -3186,7 +3186,7 @@ if(SDL_SHARED) "$>>" "$" ) - target_link_libraries(SDL3 PUBLIC $) + target_link_libraries(SDL3 PUBLIC $) # This picks up all the compiler options and such we've accumulated up to here. target_link_libraries(SDL3 PRIVATE $) target_link_libraries(SDL3 PRIVATE $) @@ -3230,7 +3230,7 @@ if(SDL_STATIC) "$>>" "$" ) - target_link_libraries(SDL3-static PUBLIC $) + target_link_libraries(SDL3-static PUBLIC $) # This picks up all the compiler options and such we've accumulated up to here. target_link_libraries(SDL3-static PRIVATE $) target_link_libraries(SDL3-static PRIVATE $) @@ -3273,7 +3273,7 @@ if(SDL_TEST) PRIVATE "$>>" ) - target_link_libraries(SDL3_test PUBLIC $) + target_link_libraries(SDL3_test PUBLIC $) target_link_libraries(SDL3_test PRIVATE ${EXTRA_TEST_LIBS}) endif() @@ -3314,7 +3314,7 @@ if(NOT SDL_DISABLE_INSTALL) ##### Installation targets ##### - install(TARGETS SDL3_headers EXPORT SDL3headersTargets) + install(TARGETS SDL3_Headers EXPORT SDL3headersTargets) if(SDL_SHARED) install(TARGETS SDL3 EXPORT SDL3Targets diff --git a/VisualC/pkg-support/cmake/sdl3-config.cmake b/VisualC/pkg-support/cmake/sdl3-config.cmake index 2caa7eee7..a00e7888d 100644 --- a/VisualC/pkg-support/cmake/sdl3-config.cmake +++ b/VisualC/pkg-support/cmake/sdl3-config.cmake @@ -50,14 +50,14 @@ set(SDL3TEST_LIBRARY SDL3::SDL3_test) # All targets are created, even when some might not be requested though COMPONENTS. # This is done for compatibility with CMake generated SDL3-target.cmake files. -if(NOT TARGET SDL3::headers) - add_library(SDL3::headers INTERFACE IMPORTED) +if(NOT TARGET SDL3::Headers) + add_library(SDL3::Headers INTERFACE IMPORTED) set_target_properties(SDL3::SDL3 PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_sdl3_include_dirs}" ) endif() -set(SDL3_headers_FOUND TRUE) +set(SDL3_Headers_FOUND TRUE) unset(_sdl3_include_dirs) set(_sdl3_library "${SDL3_LIBDIR}/SDL3.lib") @@ -67,7 +67,7 @@ if(EXISTS "${_sdl3_library}" AND EXISTS "${_sdl3_dll_library}") add_library(SDL3::SDL3 SHARED IMPORTED) set_target_properties(SDL3::SDL3 PROPERTIES - INTERFACE_LINK_LIBRARIES "SDL3::headers" + INTERFACE_LINK_LIBRARIES "SDL3::Headers" IMPORTED_IMPLIB "${_sdl3_library}" IMPORTED_LOCATION "${_sdl3_dll_library}" COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" @@ -87,7 +87,7 @@ if(EXISTS "${_sdl3test_library}") add_library(SDL3::SDL3_test STATIC IMPORTED) set_target_properties(SDL3::SDL3_test PROPERTIES - INTERFACE_LINK_LIBRARIES "SDL3::headers" + INTERFACE_LINK_LIBRARIES "SDL3::Headers" IMPORTED_LOCATION "${_sdl3test_library}" ) endif() diff --git a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake index 708744d13..fd09ec046 100644 --- a/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake +++ b/Xcode/SDL/pkg-support/resources/CMake/sdl3-config.cmake @@ -44,15 +44,15 @@ set(SDL3_LIBRARIES "SDL3::SDL3") # All targets are created, even when some might not be requested though COMPONENTS. # This is done for compatibility with CMake generated SDL3-target.cmake files. -if(NOT TARGET SDL3::headers) - add_library(SDL3::headers INTERFACE IMPORTED) - set_target_properties(SDL3::headers +if(NOT TARGET SDL3::Headers) + add_library(SDL3::Headers INTERFACE IMPORTED) + set_target_properties(SDL3::Headers PROPERTIES INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl3_framework_parent_path}\"" INTERFACE_INCLUDE_DIRECTORIES "${_sdl3_include_dirs}" ) endif() -set(SDL3_headers_FOUND TRUE) +set(SDL3_Headers_FOUND TRUE) unset(_sdl3_include_dirs) if(NOT TARGET SDL3::SDL3) @@ -60,7 +60,7 @@ if(NOT TARGET SDL3::SDL3) set_target_properties(SDL3::SDL3 PROPERTIES FRAMEWORK "TRUE" - INTERFACE_LINK_LIBRARIES "SDL3::headers" + INTERFACE_LINK_LIBRARIES "SDL3::Headers" IMPORTED_LOCATION "${_sdl3_framework_path}/SDL3" IMPORTED_SONAME "${_sdl3_framework_path}/SDL3" COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" diff --git a/cmake/SDL3Config.cmake.in b/cmake/SDL3Config.cmake.in index 6580674f1..0bbdd2302 100644 --- a/cmake/SDL3Config.cmake.in +++ b/cmake/SDL3Config.cmake.in @@ -11,15 +11,15 @@ set_package_properties(SDL3 PROPERTIES set(SDL3_FOUND TRUE) set(_sdl3_framework @SDL_FRAMEWORK@) -# Find SDL3::headers -if(NOT TARGET SDL3::headers) +# Find SDL3::Headers +if(NOT TARGET SDL3::Headers) include("${CMAKE_CURRENT_LIST_DIR}/SDL3headersTargets.cmake") # Manually add `-F ` to make sure `#include "SDL3/..."` works. if(_sdl3_framework) - set_property(TARGET SDL3::headers APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "SHELL:-F \"@PACKAGE_CMAKE_INSTALL_PREFIX@\"") + set_property(TARGET SDL3::Headers APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "SHELL:-F \"@PACKAGE_CMAKE_INSTALL_PREFIX@\"") endif() endif() -set(SDL3_headers_FOUND TRUE) +set(SDL3_Headers_FOUND TRUE) # Find SDL3::SDL3 if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/SDL3Targets.cmake") diff --git a/cmake/test/CMakeLists.txt b/cmake/test/CMakeLists.txt index 6b38947c4..48ffb65f7 100644 --- a/cmake/test/CMakeLists.txt +++ b/cmake/test/CMakeLists.txt @@ -27,9 +27,9 @@ add_feature_info("TEST_SHARED" TEST_SHARED "Test linking with shared library") option(TEST_STATIC "Test linking to static SDL3 library" ON) add_feature_info("TEST_STATIC" TEST_STATIC "Test linking with static library") -find_package(SDL3 REQUIRED CONFIG COMPONENTS headers) +find_package(SDL3 REQUIRED CONFIG COMPONENTS Headers) add_library(headers_test OBJECT inc_sdl_slash.c inc_sdl_noslash.c) -target_link_libraries(headers_test PRIVATE SDL3::headers) +target_link_libraries(headers_test PRIVATE SDL3::Headers) if(TEST_SHARED) find_package(SDL3 REQUIRED CONFIG COMPONENTS SDL3)