Merge pull request #1 from sherjilozair/fix

Copy SDL2_DLL only if it exists
This commit is contained in:
Noel Berry 2021-01-02 20:34:19 -08:00 committed by GitHub
commit be0000ab4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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} $<TARGET_FILE_DIR:game>)
if (EXISTS ${SDL2_DLL})
add_custom_command(
TARGET game POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${SDL2_DLL} $<TARGET_FILE_DIR:game>)
endif()
endif()