From 8cff6aef7d14a16b820254f646e2f22535925d8d Mon Sep 17 00:00:00 2001 From: Tom Hulton-Harrop Date: Sun, 29 Oct 2023 21:23:12 +0000 Subject: [PATCH] copy shader files to build directory - update visual studio debugger directory as well --- CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d67104a..b56fc68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,12 +49,20 @@ if (EMSCRIPTEN) ${CMAKE_CURRENT_SOURCE_DIR}/shader/embuild/f_simple.bin $/shader/embuild VERBATIM) +else () + add_custom_command( + TARGET ${PROJECT_NAME} + POST_BUILD + COMMAND + ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/shader/build + $/shader/build + VERBATIM) endif () set_target_properties( ${PROJECT_NAME} # required for project when using visual studio generator - PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) + PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/$) if (WIN32) # copy the SDL2.dll to the same folder as the executable