From e117e85e7f7c690bf0c13d448274444cf859f830 Mon Sep 17 00:00:00 2001 From: Jan Mrna Date: Thu, 16 Oct 2025 10:55:08 +0200 Subject: [PATCH] CMake: copy resources to build dir (linux+win) --- CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d4893a..29fe210 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,13 +107,6 @@ if(WIN32) ${GLEW_TARGET} ) - # Copy resources after build (Windows only) - add_custom_command(TARGET pathfinding_demo POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_directory - ${CMAKE_SOURCE_DIR}/cpp/resources - $/resources - ) - # Add compile flags for Windows (vcpkg handles most of this automatically) if(MSVC) if(SDL3_CFLAGS_OTHER) @@ -133,6 +126,14 @@ else() target_compile_options(pathfinding_demo PRIVATE ${SDL3_CFLAGS_OTHER}) endif() + +# Copy resources after build +add_custom_command(TARGET pathfinding_demo POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory + ${CMAKE_SOURCE_DIR}/cpp/resources + $/resources +) + # Test executable add_executable(tests cpp/test/test.cpp) if(WIN32)