|
31 | 31 | #include <gz/utils/Subprocess.hh> |
32 | 32 |
|
33 | 33 | #include "gz/sim/config.hh" |
| 34 | +#include "gz/sim/InstallationDirectories.hh" |
34 | 35 | #include "gz/sim/Server.hh" |
35 | 36 | #include "gz/sim/ServerConfig.hh" |
36 | 37 | #include "gz.hh" |
@@ -495,7 +496,10 @@ int main(int argc, char** argv) |
495 | 496 | utils::setenv( |
496 | 497 | std::string("GZ_SIM_WAIT_GUI"), |
497 | 498 | std::to_string(opt->waitGui)); |
498 | | - launchProcess(std::string(GZ_SIM_GUI_EXE), createGuiCommand(opt)); |
| 499 | + std::string gz_sim_gui_exe = gz::common::joinPaths( |
| 500 | + sim::getInstallPrefix(), |
| 501 | + GZ_SIM_GUI_EXE_RELATIVE_PATH); |
| 502 | + launchProcess(gz_sim_gui_exe, createGuiCommand(opt)); |
499 | 503 | } |
500 | 504 | catch (const std::exception &e) |
501 | 505 | { |
@@ -578,7 +582,10 @@ int main(int argc, char** argv) |
578 | 582 | else if(opt->launchGui) |
579 | 583 | { |
580 | 584 | #ifdef WITH_GUI |
581 | | - launchProcess(std::string(GZ_SIM_GUI_EXE), createGuiCommand(opt)); |
| 585 | + std::string gz_sim_gui_exe = gz::common::joinPaths( |
| 586 | + sim::getInstallPrefix(), |
| 587 | + GZ_SIM_GUI_EXE_RELATIVE_PATH); |
| 588 | + launchProcess(gz_sim_gui_exe, createGuiCommand(opt)); |
582 | 589 | #else |
583 | 590 | std::cerr << "This version of Gazebo does not support GUI" << std::endl; |
584 | 591 | #endif |
|
0 commit comments