Copy SDL2_DLL only if it exists

This commit is contained in:
Sherjil Ozair 2021-01-03 02:46:20 +00:00
parent dd1bbbc9de
commit 2397ae4c67

View File

@ -38,7 +38,9 @@ target_link_libraries(game blah)
# copy SDL2 to the build directory # copy SDL2 to the build directory
set(SDL2_DLL "" CACHE FILEPATH "SDL2 DLL Path") set(SDL2_DLL "" CACHE FILEPATH "SDL2 DLL Path")
if (SDL2_ENABLED) if (SDL2_ENABLED)
add_custom_command( if (EXISTS ${SDL2_DLL})
TARGET game POST_BUILD add_custom_command(
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $<TARGET_FILE_DIR:game>) TARGET game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $<TARGET_FILE_DIR:game>)
endif()
endif() endif()