sdl12-compat: If building the test programs, copy their data files to the build directory.

From 9536bac8c6a71d9e2b8cd3ce4dcc7a75a6bd78c0 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 24 May 2021 11:16:38 -0400
Subject: [PATCH] If building the test programs, copy their data files to the
 build directory.

---
 CMakeLists.txt | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9bdb259..f664f2c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -134,6 +134,10 @@ if(SDL12TESTS)
     else()
         target_link_libraries(testgl "GL")
     endif()
+
+    foreach(fname "icon.bmp" "moose.dat" "picture.xbm" "sail.bmp" "sample.bmp" "sample.wav" "utf8.txt")
+        file(COPY "${CMAKE_SOURCE_DIR}/test/${fname}" DESTINATION "${CMAKE_BINARY_DIR}")
+    endforeach(fname)
 endif()
 
 install(TARGETS SDL