From cb0def4eb39809d6a31eb5107da94fe6dabc9dbd Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 11:56:18 -0500 Subject: [PATCH] CMake: Defer pzip's directory creation to build-time. --- cmake/macros/RunPzip.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 1e4e777c20..dd72040714 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -13,17 +13,15 @@ function(run_pzip target_name source destination glob) set(dstfiles "") foreach(filename ${files}) string(REGEX REPLACE "^/" "" filename "${filename}") - file(RELATIVE_PATH srcfile "${destination}" "${source}/${filename}") get_filename_component(dstdir "${destination}/${filename}" DIRECTORY) - file(MAKE_DIRECTORY "${dstdir}") set(dstfile "${filename}.pz") list(APPEND dstfiles "${destination}/${dstfile}") add_custom_command(OUTPUT "${destination}/${dstfile}" - COMMAND host_pzip -c > "${dstfile}" < "${srcfile}" - WORKING_DIRECTORY "${destination}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${dstdir}" + COMMAND host_pzip -c > "${destination}/${dstfile}" < "${source}/${filename}" DEPENDS host_pzip COMMENT "")