Browse Source

ExternalData: Improve error message when we fail to create a file

Report the underlying system error.
Brad King 4 years ago
parent
commit
298760661f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Modules/ExternalData.cmake

+ 1 - 1
Modules/ExternalData.cmake

@@ -949,7 +949,7 @@ function(_ExternalData_link_or_copy src dst)
   endif()
   if(result)
     file(REMOVE "${tmp}")
-    message(FATAL_ERROR "Failed to create\n  ${tmp}\nfrom\n  ${obj}")
+    message(FATAL_ERROR "Failed to create:\n  \"${tmp}\"\nfrom:\n  \"${obj}\"\nwith error:\n  ${result}")
   endif()
 
   # Atomically create/replace the real destination.