|
|
|
@ -20,7 +20,7 @@ CMake::CMake(const boost::filesystem::path &path) { |
|
|
|
|
|
|
|
|
|
|
|
auto search_path=path; |
|
|
|
auto search_path=path; |
|
|
|
auto search_cmake_path=search_path; |
|
|
|
auto search_cmake_path=search_path; |
|
|
|
search_cmake_path/="CMakeLists.txt"; |
|
|
|
search_cmake_path+="/CMakeLists.txt"; |
|
|
|
if(boost::filesystem::exists(search_cmake_path)) |
|
|
|
if(boost::filesystem::exists(search_cmake_path)) |
|
|
|
paths.emplace(paths.begin(), search_cmake_path); |
|
|
|
paths.emplace(paths.begin(), search_cmake_path); |
|
|
|
if(find_cmake_project(search_cmake_path)) |
|
|
|
if(find_cmake_project(search_cmake_path)) |
|
|
|
@ -29,7 +29,7 @@ CMake::CMake(const boost::filesystem::path &path) { |
|
|
|
do { |
|
|
|
do { |
|
|
|
search_path=search_path.parent_path(); |
|
|
|
search_path=search_path.parent_path(); |
|
|
|
search_cmake_path=search_path; |
|
|
|
search_cmake_path=search_path; |
|
|
|
search_cmake_path/="CMakeLists.txt"; |
|
|
|
search_cmake_path+="/CMakeLists.txt"; |
|
|
|
if(boost::filesystem::exists(search_cmake_path)) |
|
|
|
if(boost::filesystem::exists(search_cmake_path)) |
|
|
|
paths.emplace(paths.begin(), search_cmake_path); |
|
|
|
paths.emplace(paths.begin(), search_cmake_path); |
|
|
|
if(find_cmake_project(search_cmake_path)) { |
|
|
|
if(find_cmake_project(search_cmake_path)) { |
|
|
|
@ -49,7 +49,7 @@ bool CMake::create_compile_commands(const boost::filesystem::path &path) { |
|
|
|
if(Singleton::terminal->execute(Singleton::config->terminal.cmake_command+" . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON", path)==EXIT_SUCCESS) { |
|
|
|
if(Singleton::terminal->execute(Singleton::config->terminal.cmake_command+" . -DCMAKE_EXPORT_COMPILE_COMMANDS=ON", path)==EXIT_SUCCESS) { |
|
|
|
#ifdef _WIN32 //Temporary fix to MSYS2's libclang
|
|
|
|
#ifdef _WIN32 //Temporary fix to MSYS2's libclang
|
|
|
|
auto compile_commands_path=path; |
|
|
|
auto compile_commands_path=path; |
|
|
|
compile_commands_path/="compile_commands.json"; |
|
|
|
compile_commands_path+="/compile_commands.json"; |
|
|
|
auto compile_commands_file=filesystem::read(compile_commands_path); |
|
|
|
auto compile_commands_file=filesystem::read(compile_commands_path); |
|
|
|
size_t pos=0; |
|
|
|
size_t pos=0; |
|
|
|
while((pos=compile_commands_file.find("-I/", pos))!=std::string::npos) { |
|
|
|
while((pos=compile_commands_file.find("-I/", pos))!=std::string::npos) { |
|
|
|
|