From 8c6f76cca880ba3deb2098a64869bb808e783114 Mon Sep 17 00:00:00 2001 From: Viktor Schneider Date: Sat, 2 Feb 2019 03:42:05 +0100 Subject: [PATCH] keep prefix in front of "CMakeFiles/" for executable path of cmake target --- src/cmake.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmake.cc b/src/cmake.cc index ccb3cb3..0ef46fa 100644 --- a/src/cmake.cc +++ b/src/cmake.cc @@ -128,7 +128,8 @@ boost::filesystem::path CMake::get_executable(const boost::filesystem::path &bui auto values = command.parameter_values("-o"); if(!values.empty()) { size_t pos; - values[0].erase(0, 11); + if((pos = values[0].find("CMakeFiles/")) != std::string::npos) + values[0].erase(pos, 11); if((pos = values[0].find(".dir")) != std::string::npos) { auto executable = command.directory / values[0].substr(0, pos); command_files_and_maybe_executables.emplace_back(command_file, executable);