Make sure Windows DLL dependencies exist before trying to copy them (some may be static libs)

Fixes #768
This commit is contained in:
manuelk 2015-12-18 15:12:15 -08:00
parent 60cf73d550
commit 6a19a2aeec

View File

@ -710,12 +710,14 @@ macro(_add_glfw_executable target)
foreach (LIB ${LIBRARIES} )
string(REPLACE ".lib" ".dll" DLL ${LIB})
string(REPLACE ".LIB" ".DLL" DLL ${DLL})
add_custom_command(
TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${DLL}
$<TARGET_FILE_DIR:${target}>
)
if (EXISTS ${DLL})
add_custom_command(
TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
${DLL}
$<TARGET_FILE_DIR:${target}>
)
endif()
endforeach()
endif()