Better handle file- or path-names with spaces
This commit is contained in:
@ -31,5 +31,7 @@ set(temp "${temp}const char *LAMMPS_NS::LAMMPS::git_descriptor() { return \"${te
|
||||
set(temp "${temp}#endif\n\n")
|
||||
|
||||
message(STATUS "Generating lmpgitversion.h...")
|
||||
file(WRITE "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${temp}" )
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h.tmp" "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
|
||||
|
||||
string(REPLACE "\\ " " " LAMMPS_GIT_HEADER "${LAMMPS_STYLE_HEADERS_DIR}/lmpgitversion.h")
|
||||
file(WRITE "${LAMMPS_GIT_HEADER}.tmp" "${temp}" )
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${LAMMPS_GIT_HEADER}.tmp" "${LAMMPS_GIT_HEADER}")
|
||||
|
||||
@ -102,7 +102,7 @@ public:
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
std::string converted_file = compressed_file.substr(0, compressed_file.find_last_of('.'));
|
||||
std::string cmdline =
|
||||
fmt::format("{} -d -c {} > {}", COMPRESS_EXECUTABLE, compressed_file, converted_file);
|
||||
fmt::format("\"{}\" -d -c {} > {}", COMPRESS_EXECUTABLE, compressed_file, converted_file);
|
||||
system(cmdline.c_str());
|
||||
END_HIDE_OUTPUT();
|
||||
return converted_file;
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
std::string convert_binary_to_text(std::string binary_file)
|
||||
{
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
std::string cmdline = fmt::format("{} {}", BINARY2TXT_EXECUTABLE, binary_file);
|
||||
std::string cmdline = fmt::format("\"{}\" {}", BINARY2TXT_EXECUTABLE, binary_file);
|
||||
system(cmdline.c_str());
|
||||
END_HIDE_OUTPUT();
|
||||
return fmt::format("{}.txt", binary_file);
|
||||
|
||||
@ -100,7 +100,7 @@ public:
|
||||
std::string convert_binary_to_text(std::string binary_file)
|
||||
{
|
||||
BEGIN_HIDE_OUTPUT();
|
||||
std::string cmdline = fmt::format("{} {}", BINARY2TXT_EXECUTABLE, binary_file);
|
||||
std::string cmdline = fmt::format("\"{}\" {}", BINARY2TXT_EXECUTABLE, binary_file);
|
||||
system(cmdline.c_str());
|
||||
END_HIDE_OUTPUT();
|
||||
return fmt::format("{}.txt", binary_file);
|
||||
|
||||
Reference in New Issue
Block a user