+ std::cout << "Open selection path: "<< location << std::endl;
+ //get fixed location
+ std::string locationFixed = CDMUtilities::fixPath(location);
+ std::cout << "Opening path: "<< locationFixed << std::endl;
+
+ //creates project in disk
+#if(_WIN32)
+
+ std::string command("creaNewProject.bat ");
+ std::string command1("creaSed.exe ");
+ std::string command2("del ");
+
+ command += "\"" + locationFixed + "\" \"" + name + "\"";
+ 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()))
+ {
+ result = new std::string("An error occurred while running '" + command + "'.");
+ return false;
+ }
+
+ 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;
+ }
+
+ 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 + "\"";
+ 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\"";
+ if (system (add.c_str()))
+ {
+ result = new std::string("An error occurred while running '" + add + "'.");
+ return false;
+ }
+
+ this->project = new modelCDMProject(NULL, nomDirectory, name);
+
+#else
+ // ------ LINUX / MacOS
+ std::string command("creaNewProject.sh ");
+ command += "\"" + locationFixed + "\"" +" \"" + name + "\"";
+ //std::cout << "executing " << command << std::endl;
+ if (system ( command.c_str() ) )
+ {
+ result = new std::string("An error occured while running '" + command + "'.");
+ return false;
+ }
+
+ 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 + "\"";
+ //std::cout << "executing " << bbCreatePackage << std::endl;
+ system (bbCreatePackage.c_str());
+
+ std::string add;
+ add = "echo 'ADD_SUBDIRECTORY(bbtk_" + name + "_PKG)' >> \"" + nomDirectory + CDMUtilities::SLASH + "CMakeLists.txt\"";
+
+ //std::cout << "executing " << add << std::endl;
+ system(add.c_str());
+
+ if(this->project != NULL)
+ {
+ if (!CloseProject(result))
+ return false;
+ }
+
+ this->project = new modelCDMProject(NULL, nomDirectory, name);
+
+#endif
+