Revision: 77718
http://sourceforge.net/p/brlcad/code/77718
Author: starseeker
Date: 2020-11-10 17:16:20 +0000 (Tue, 10 Nov 2020)
Log Message:
-----------
Ugh. Looks like file(COPY) has some odd limitations when it comes to filenames
with spaces in paths - it works some of the time, but not all the time
(https://gitlab.kitware.com/cmake/cmake/-/issues/21420). Hate to do it, but
may have to fall back on native tools for this until file(COPY) gets sorted.
Modified Paths:
--------------
brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
Modified:
brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
===================================================================
--- brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
2020-11-10 14:48:53 UTC (rev 77717)
+++ brlcad/branches/extbuild/src/other/ext/CMake/ExternalProject_Target.cmake
2020-11-10 17:16:20 UTC (rev 77718)
@@ -24,7 +24,21 @@
# cmake -E copy follows symlinks to get the final file, which is not what we
# want in this situation. To avoid this, we create a copy script which uses
# file(COPY) and run that script with cmake -P
-file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake"
"get_filename_component(DDIR \${DEST} DIRECTORY)\nfile(COPY \${SRC} DESTINATION
\${DDIR})")
+file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/cp.cmake" "
+get_filename_component(DNAME \"\${DEST}\" NAME)
+string(REGEX REPLACE \"\${DNAME}$\" \"\" DDIR \"\${DEST}\")
+if (NOT WIN32)
+ string(REPLACE \"\\\\ \" \" \" SDIR \"\${SRC}\")
+ string(REPLACE \"\\\\ \" \" \" DDIR \"\${DDIR}\")
+ execute_process(COMMAND mkdir -p \${DDIR})
+ execute_process(COMMAND cp \${SDIR} \${DDIR} RESULT_VARIABLE CPRESULT)
+ if (CPRESULT)
+ message(FATAL_ERROR \"COPY FAILURE: cp \${SDIR} \${DDIR}\")
+ endif (CPRESULT)
+else (NOT WIN32)
+ file(COPY \"\${SRC}\" DESTINATION \"\${DDIR}\")
+endif (NOT WIN32)
+")
# When staging files in the build directory, we have to be aware of multiple
# configurations. This is done post-ExternalProject build, at the parent build
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits