From 89fe32ddf91bec36d1469dbd030e7d9e2e0f883d Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sun, 5 Apr 2020 08:46:59 -0700 Subject: [PATCH] Fixed bug 5072 - Test resources missing when building with SDL_TEST and CMake DominikD There are several tests that need resources in the output directory to work: * `testiconv` depends on `utf8.txt` * `testoverlay2` and `teststreaming` depend on `moose.dat` This patch adds these two files to the `RESOURCE_FILES` variable. One could also copy `shapes\*.bmp` over to the output directory for `testshape` to use but this patch doesn't do that for three reasons: * executable takes path as an argument and doesn't need these files side by side * these are ~45MB and copying them over would cause build directory to swell * there are already files in the output directory that can be used with this test (`sample.bmp` and `button.bmp`) --- test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a380bc8042a99..879800575c36a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -94,7 +94,7 @@ add_executable(testoffscreen testoffscreen.c) file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/resources_dummy.c "int main(int argc, const char **argv){ return 1; }\n") add_executable(SDL2_test_resoureces ${CMAKE_CURRENT_BINARY_DIR}/resources_dummy.c) -file(GLOB RESOURCE_FILES *.bmp *.wav) +file(GLOB RESOURCE_FILES *.bmp *.wav moose.dat utf8.txt) foreach(RESOURCE_FILE ${RESOURCE_FILES}) add_custom_command(TARGET SDL2_test_resoureces POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${RESOURCE_FILE} $) endforeach(RESOURCE_FILE)