Avoid unix-based mkdir usage on windows.

This commit is contained in:
Shyotl
2015-01-29 04:03:45 -06:00
parent a0487b12be
commit 91b6d68eae
2 changed files with 7 additions and 4 deletions

View File

@@ -26,13 +26,13 @@ function(copy_files paths names dest)
foreach(f ${names})
foreach(p ${paths})
set(from_file "${p}/${f}")
set(to_dest "${CMAKE_BINARY_DIR}/newview/${dest}")
set(to_dest "${CMAKE_BINARY_DIR}/newview/${dest}/")
if(EXISTS ${from_file})
message("Copying ${from_file} to ${to_dest}")
if(NOT EXISTS ${to_dest})
execute_process(COMMAND mkdir -p "${to_dest}")
execute_process(COMMAND md "${to_dest}")
endif(NOT EXISTS ${to_dest})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${from_file} ${to_dest} RESULT_VARIABLE result)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${from_file}" "${to_dest}${f}" RESULT_VARIABLE result)
if(${result})
message(SEND_ERROR "Unsuccessful.")
endif(${result})