Browse Source

Check that input dll exists before copying it.

Former-commit-id: 1d42c858a6b5c4c26f3af9402c908dd80715d95a
Jérémie Dumas 7 years ago
parent
commit
10f860d563
1 changed files with 3 additions and 1 deletions
  1. 3 1
      shared/cmake/libigl.cmake

+ 3 - 1
shared/cmake/libigl.cmake

@@ -155,7 +155,9 @@ function(igl_copy_imported_locations src_target dst_target)
   get_target_property(configurations ${src_target} IMPORTED_CONFIGURATIONS)
   foreach(config ${configurations})
     get_target_property(location ${src_target} IMPORTED_LOCATION_${config})
-    add_custom_command(TARGET ${dst_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${location}" $<TARGET_FILE_DIR:${dst_target}>)
+    if(EXISTS "${location}")
+      add_custom_command(TARGET ${dst_target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${location}" $<TARGET_FILE_DIR:${dst_target}>)
+    endif()
   endforeach()
 endfunction()