From efbeaab1ca7c02e38bf701ed20082cb3150419ee Mon Sep 17 00:00:00 2001 From: hobyst <48522412+hobyst@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:08:27 +0000 Subject: [PATCH] SFML dependency wrapper code cleanup (#551) - Remove remnant of SFML <= 2.4 support - Add prefix to variable names on loop - Fix a typo in a comment --- CMake/Backends.cmake | 4 ++-- CMake/BackendsDependencies.cmake | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CMake/Backends.cmake b/CMake/Backends.cmake index 8118621e9..75092d29a 100644 --- a/CMake/Backends.cmake +++ b/CMake/Backends.cmake @@ -1,7 +1,7 @@ #[[ Details about sample backends, their source code files and linking requirements - Everytime a new backend gets added or its target name is modified, please update + Every time a new backend gets added or its target name is modified, please update the list of available backends found in OptionsLists.cmake This file is not meant to be used by consumers of the library, only by the RmlUi CMake project @@ -114,7 +114,7 @@ target_sources(rmlui_backend_SFML_GL2 INTERFACE "${PROJECT_SOURCE_DIR}/Backends/RmlUi_Renderer_GL2.h" ) target_link_libraries(rmlui_backend_SFML_GL2 INTERFACE - rmlui_backend_common_headers OpenGL::GL rmlui_SFML_old_wrapper SFML::Graphics SFML::Window SFML::System + rmlui_backend_common_headers OpenGL::GL SFML::Graphics SFML::Window SFML::System ) add_library(rmlui_backend_GLFW_GL2 INTERFACE) diff --git a/CMake/BackendsDependencies.cmake b/CMake/BackendsDependencies.cmake index 8860fbfcc..fc6d5407a 100644 --- a/CMake/BackendsDependencies.cmake +++ b/CMake/BackendsDependencies.cmake @@ -134,11 +134,11 @@ if(RMLUI_SAMPLES_BACKEND MATCHES "^SFML") ]] # For each SFML component the project requires - foreach(sfml_component ${RMLUI_SFML_REQUIRED_COMPONENTS}) + foreach(rmlui_sfml_component ${RMLUI_SFML_REQUIRED_COMPONENTS}) # Make the component name lowercase - string(TOLOWER ${sfml_component} sfml_component_lower) + string(TOLOWER ${rmlui_sfml_component} rmlui_sfml_component_lower) - if(TARGET sfml-${sfml_component_lower}) + if(TARGET sfml-${rmlui_sfml_component_lower}) #[[ RMLUI_CMAKE_MINIMUM_VERSION_RAISE_NOTICE: Because the target CMake version is 3.10, we can't alias non-global targets nor global imported targets. @@ -150,14 +150,10 @@ if(RMLUI_SAMPLES_BACKEND MATCHES "^SFML") ]] # If the target exists, alias it - add_library(SFML::${sfml_component} INTERFACE IMPORTED) - target_link_libraries(SFML::${sfml_component} INTERFACE sfml-${sfml_component_lower}) + add_library(SFML::${rmlui_sfml_component} INTERFACE IMPORTED) + target_link_libraries(SFML::${rmlui_sfml_component} INTERFACE sfml-${rmlui_sfml_component_lower}) endif() endforeach() - - # Because module-specific targets already exist, there's no need for the wrapper for the older find module - # Set up wrapper target as dumb target - add_library(rmlui_SFML_old_wrapper INTERFACE) endif() endif()