SDL_image: Use newly added FindSDL2(main|test).cmake modules in test/CMakeLists.txt

From 22c4127100e81d58a913085213adbe1957f7c8a1 Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Wed, 25 May 2022 18:07:38 +0200
Subject: [PATCH] Use newly added FindSDL2(main|test).cmake  modules in
 test/CMakeLists.txt

---
 test/CMakeLists.txt | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index aff22ae..f10d885 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,3 +1,6 @@
+find_package(SDL2main)
+find_package(SDL2test REQUIRED)
+
 add_executable(testimage main.c)
 
 set(ALL_TESTS
@@ -38,7 +41,7 @@ foreach(prog ${ALL_TESTS})
     if(TARGET SDL2::SDL2main)
         target_link_libraries(${prog} PRIVATE SDL2::SDL2main)
     endif()
-    target_link_libraries(${prog} PRIVATE SDL2_test ${sdl2_target_name})
+    target_link_libraries(${prog} PRIVATE SDL2::SDL2test ${sdl2_target_name})
 
     add_test(
         NAME ${prog}