X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcreaDevManagerLib%2FmodelCDMMain.cpp;h=7b47e90035841b8cafb42d19a26113b6246ba121;hb=921c85646eb457d9e8cfc1a9031481df176970ce;hp=e856fd2bae2f847f2d318a55bee08a3679283cfc;hpb=5ff0bb2664c3cd508c1dd438666a71b8a96459c3;p=crea.git diff --git a/lib/creaDevManagerLib/modelCDMMain.cpp b/lib/creaDevManagerLib/modelCDMMain.cpp index e856fd2..7b47e90 100644 --- a/lib/creaDevManagerLib/modelCDMMain.cpp +++ b/lib/creaDevManagerLib/modelCDMMain.cpp @@ -83,9 +83,8 @@ bool modelCDMMain::CreateProject( std::string command2("del "); command += "\"" + locationFixed + "\" \"" + name + "\""; - command1 += "\"" + locationFixed +CDMUtilities::SLASH+name+CDMUtilities::SLASH+"CMakeLists.txt.in\" " + "NameOfTheProject " + name + "> \"" + locationFixed + CDMUtilities::SLASH + name + CDMUtilities::SLASH + "CMakeLists.txt\""; - command2 += "\"" + locationFixed +CDMUtilities::SLASH+name+CDMUtilities::SLASH+"CMakeLists.txt.in\""; - + command1 += "\"" + locationFixed + CDMUtilities::SLASH + name + CDMUtilities::SLASH + "CMakeLists.txt.in\" " + "PROJECT_NAME " + name + "> \"" + locationFixed + CDMUtilities::SLASH + name + CDMUtilities::SLASH + "CMakeLists.txt\""; + command2 += "\"" + locationFixed + CDMUtilities::SLASH + name + CDMUtilities::SLASH + "CMakeLists.txt.in\""; if (system (command.c_str())) { @@ -93,20 +92,35 @@ bool modelCDMMain::CreateProject( return false; } - system ( command1.c_str() ); - system ( command2.c_str() ); + if (system (command1.c_str())) + { + result = new std::string("An error occurred while running '" + command1 + "'."); + return false; + } + if (system (command2.c_str())) + { + result = new std::string("An error occurred while running '" + command2 + "'."); + return false; + } - char *author = author.c_str(); std::string nomDirectory = locationFixed + CDMUtilities::SLASH + name; std::string nomPackageDirectory = nomDirectory + CDMUtilities::SLASH + "bbtk_" + name + "_PKG"; std::string bbCreatePackage("bbCreatePackage "); bbCreatePackage += "\"" + nomDirectory + "\" \"" + name + "\" \"" + author + "\" \"" + description + "\""; - system (bbCreatePackage.c_str()); + if (!system (bbCreatePackage.c_str())) + { + result = new std::string("An error occurred while running '" + bbCreatePackage + "'."); + return false; + } std::string add; add = "echo ADD_SUBDIRECTORY(bbtk_" + name + "_PKG) >> \"" + nomDirectory + CDMUtilities::SLASH + "CMakeLists.txt\""; - system(add.c_str()); + if (system (add.c_str())) + { + result = new std::string("An error occurred while running '" + add + "'."); + return false; + } - this->project = new modelCDMProject(nomDirectory, name); + this->project = new modelCDMProject(NULL, nomDirectory, name); #else // ------ LINUX / MacOS