|
|
|
@ -151,7 +151,7 @@ boost::filesystem::path CMake::get_executable(const boost::filesystem::path &bui |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
boost::optional<size_t> best_match_size; |
|
|
|
ssize_t best_match_size = -1; |
|
|
|
boost::filesystem::path best_match_executable; |
|
|
|
boost::filesystem::path best_match_executable; |
|
|
|
|
|
|
|
|
|
|
|
for(auto &cmake_executable : cmake_executables) { |
|
|
|
for(auto &cmake_executable : cmake_executables) { |
|
|
|
@ -163,7 +163,7 @@ boost::filesystem::path CMake::get_executable(const boost::filesystem::path &bui |
|
|
|
return maybe_executable; |
|
|
|
return maybe_executable; |
|
|
|
auto command_file_directory = command_file.parent_path(); |
|
|
|
auto command_file_directory = command_file.parent_path(); |
|
|
|
if(filesystem::file_in_path(file_path, command_file_directory)) { |
|
|
|
if(filesystem::file_in_path(file_path, command_file_directory)) { |
|
|
|
auto size = static_cast<size_t>(std::distance(command_file_directory.begin(), command_file_directory.end())); |
|
|
|
auto size = std::distance(command_file_directory.begin(), command_file_directory.end()); |
|
|
|
if(size > best_match_size) { |
|
|
|
if(size > best_match_size) { |
|
|
|
best_match_size = size; |
|
|
|
best_match_size = size; |
|
|
|
best_match_executable = maybe_executable; |
|
|
|
best_match_executable = maybe_executable; |
|
|
|
@ -182,7 +182,7 @@ boost::filesystem::path CMake::get_executable(const boost::filesystem::path &bui |
|
|
|
return maybe_executable; |
|
|
|
return maybe_executable; |
|
|
|
auto command_file_directory = command_file.parent_path(); |
|
|
|
auto command_file_directory = command_file.parent_path(); |
|
|
|
if(filesystem::file_in_path(file_path, command_file_directory)) { |
|
|
|
if(filesystem::file_in_path(file_path, command_file_directory)) { |
|
|
|
auto size = static_cast<size_t>(std::distance(command_file_directory.begin(), command_file_directory.end())); |
|
|
|
auto size = std::distance(command_file_directory.begin(), command_file_directory.end()); |
|
|
|
if(size > best_match_size) { |
|
|
|
if(size > best_match_size) { |
|
|
|
best_match_size = size; |
|
|
|
best_match_size = size; |
|
|
|
best_match_executable = maybe_executable; |
|
|
|
best_match_executable = maybe_executable; |
|
|
|
|