From 2397ae4c677a862cf53b7139b0a40959f181feb6 Mon Sep 17 00:00:00 2001 From: Sherjil Ozair Date: Sun, 3 Jan 2021 02:46:20 +0000 Subject: [PATCH] Copy SDL2_DLL only if it exists --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 57a3050..0305e4b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,7 +38,9 @@ target_link_libraries(game blah) # copy SDL2 to the build directory set(SDL2_DLL "" CACHE FILEPATH "SDL2 DLL Path") if (SDL2_ENABLED) - add_custom_command( - TARGET game POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $) + if (EXISTS ${SDL2_DLL}) + add_custom_command( + TARGET game POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $) + endif() endif() \ No newline at end of file