ExternalProject: Extract and then rename crashes for source archive (extract-<PROJECT>.cmake)
here is a generated extract cmake file for boost: Extract-BOOST.cmake
# Extract it:
#
message(STATUS "extracting... [tar xfz]")
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xfz ${filename}
WORKING_DIRECTORY ${ut_dir}
RESULT_VARIABLE rv)
if(NOT rv EQUAL 0)
message(STATUS "extracting... [error clean up]")
file(REMOVE_RECURSE "${ut_dir}")
message(FATAL_ERROR "error: extract of '${filename}' failed")
endif()
# Analyze what came out of the tar file:
#
message(STATUS "extracting... [analysis]")
file(GLOB contents "${ut_dir}/*")
list(LENGTH contents n)
if(NOT n EQUAL 1 OR NOT IS_DIRECTORY "${contents}")
set(contents "${ut_dir}")
endif()
# Move "the one" directory to the final directory:
#
message(STATUS "extracting... [rename]")
file(REMOVE_RECURSE ${directory})
get_filename_component(contents ${contents} ABSOLUTE)
file(RENAME ${contents} ${directory})
# Clean up:
#
message(STATUS "extracting... [clean up]")
file(REMOVE_RECURSE "${ut_dir}")
message(STATUS "extracting... done")
Below file(RENAME ${contents} ${directory}) fails on windows. Issue has be occured wil large source archives such as boost, qt4, ITK Smaller archives works without any issue.
can we not have a "file(RENAME..." command and simply extract the archive to a given name ? cmake generator: visual studio 2015 x86 os info: windows 10, 12.0GB RAM, x64 based processor cmake version: 3.5.2