X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMProject.cpp;fp=lib%2FcreaDevManagerLib%2FmodelCDMProject.cpp;h=501d059d9892e0bbc0742f8cfe82ccba3426263c;hb=bbdef4f90fba618806e17e589b7d71cc76095f5b;hp=50f6cc24373699ddd13a1fd8113b4daa23edad6b;hpb=11150e550ff03ee658e90cda4b475b4c24da0a7f;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMProject.cpp b/lib/creaDevManagerLib/modelCDMProject.cpp index 50f6cc2..501d059 100644 --- a/lib/creaDevManagerLib/modelCDMProject.cpp +++ b/lib/creaDevManagerLib/modelCDMProject.cpp @@ -248,6 +248,12 @@ modelCDMLib* modelCDMProject::GetLib() const return this->lib; } +std::string modelCDMProject::GetBuildInstruction() const +{ + std::string makeComm = "make -C \"" + this->buildPath + "\""; /*> \"" + this->buildPath + CDMUtilities::SLASH + "building.log\" 2>&1";*/ + return makeComm; +} + bool modelCDMProject::SetVersion(const std::string& version, std::string*& result) { @@ -706,7 +712,7 @@ bool modelCDMProject::ConfigureBuild(std::string*& result) return true; } -bool modelCDMProject::Build(std::string*& result) +bool modelCDMProject::Build(std::string*& result, const std::string& line) { //TODO: adjust for windows and mac #ifdef _WIN32 @@ -725,7 +731,25 @@ bool modelCDMProject::Build(std::string*& result) return false; } //create make command - std::string makeComm = "make -C \"" + this->buildPath + "\" > \"" + this->buildPath + CDMUtilities::SLASH + "building.log\" 2>&1"; + std::string makeComm = "gnome-terminal -e \"bash -c \\\""; + for (int i = 0; i < line.size(); i++) + { + if(line[i] == '"') + { + makeComm+="\\\\\\\""; + } + else if(line[i] == '\\') + { + makeComm+="\\\\\\\\"; + } + else + { + makeComm.push_back(line[i]); + } + } + makeComm += "; echo -e '\\a'; bash"; + makeComm += "\\\"\""; + std::cout << "executing '" << makeComm << "'" << std::endl; //execute make command if(system(makeComm.c_str())) @@ -763,7 +787,7 @@ bool modelCDMProject::Connect(std::string*& result) if(system(plugComm.c_str())) { //if there was an error then report it - result = new std::string("There was an error plugging the packages of the project, please check the \"plugging.log\" file located in the build folder to read more about the problem."); + result = new std::string("There was an error plugging the packages of the project, please check the console to read more about the problem."); return false; } #endif