|
|
|
|
@ -540,9 +540,16 @@ void Window::set_menu_actions() {
|
|
|
|
|
if(cmake.project_path!="") { |
|
|
|
|
if(executable_path!="") { |
|
|
|
|
compiling=true; |
|
|
|
|
Terminal::get().print("Compiling and running "+executable_path.string()+"\n"); |
|
|
|
|
auto project_path=cmake.project_path; |
|
|
|
|
Terminal::get().async_process(Config::get().terminal.make_command, cmake.project_path, [this, executable_path, project_path](int exit_status){ |
|
|
|
|
auto default_build_path=CMake::get_default_build_path(project_path); |
|
|
|
|
auto executable_path_string=executable_path.string(); |
|
|
|
|
size_t pos=executable_path_string.find(project_path.string()); |
|
|
|
|
if(pos!=std::string::npos) { |
|
|
|
|
executable_path_string.replace(pos, project_path.string().size(), default_build_path.string()); |
|
|
|
|
executable_path=executable_path_string; |
|
|
|
|
} |
|
|
|
|
Terminal::get().print("Compiling and running "+executable_path.string()+"\n"); |
|
|
|
|
Terminal::get().async_process(Config::get().terminal.make_command, default_build_path, [this, executable_path, default_build_path](int exit_status){ |
|
|
|
|
compiling=false; |
|
|
|
|
if(exit_status==EXIT_SUCCESS) { |
|
|
|
|
auto executable_path_spaces_fixed=executable_path.string(); |
|
|
|
|
@ -554,7 +561,7 @@ void Window::set_menu_actions() {
|
|
|
|
|
} |
|
|
|
|
last_char=executable_path_spaces_fixed[c]; |
|
|
|
|
} |
|
|
|
|
Terminal::get().async_process(executable_path_spaces_fixed, project_path, [this, executable_path](int exit_status){ |
|
|
|
|
Terminal::get().async_process(executable_path_spaces_fixed, default_build_path, [this, executable_path](int exit_status){ |
|
|
|
|
Terminal::get().async_print(executable_path.string()+" returned: "+std::to_string(exit_status)+'\n'); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
@ -581,7 +588,7 @@ void Window::set_menu_actions() {
|
|
|
|
|
if(cmake.project_path!="") { |
|
|
|
|
compiling=true; |
|
|
|
|
Terminal::get().print("Compiling project "+cmake.project_path.string()+"\n"); |
|
|
|
|
Terminal::get().async_process(Config::get().terminal.make_command, cmake.project_path, [this](int exit_status){ |
|
|
|
|
Terminal::get().async_process(Config::get().terminal.make_command, CMake::get_default_build_path(cmake.project_path), [this](int exit_status){ |
|
|
|
|
compiling=false; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|