diff --git a/ofxProjectGenerator/src/addons/ofAddon.cpp b/ofxProjectGenerator/src/addons/ofAddon.cpp index 8523d340..3d747f0b 100644 --- a/ofxProjectGenerator/src/addons/ofAddon.cpp +++ b/ofxProjectGenerator/src/addons/ofAddon.cpp @@ -5,13 +5,13 @@ * Author: arturo */ -#include "ofAddon.h" #include "ofUtils.h" #include "ofFileUtils.h" +#include "ofAddon.h" #include "Utils.h" -#include "Poco/String.h" #include "Poco/RegularExpression.h" #include +#include using namespace std; vector splitStringOnceByLeft(const string &source, const string &delimiter) { @@ -149,6 +149,15 @@ void ofAddon::addReplaceString(string & variable, string value, bool addToVariab } void ofAddon::addReplaceStringVector(std::vector & variable, std::string value, std::string prefix, bool addToVariable){ + +// cout << "======= addReplaceStringVector " << endl; +// cout << "value : " << value << endl; +// cout << "prefix : " << prefix << endl; +// cout << "addToVariable : " << addToVariable << endl; +// cout << "___INPUT" << endl; +// for (auto & v : variable) { +// cout << v << endl; +// } vector values; if(value.find("\"")!=string::npos){ values = ofSplitString(value,"\"",true,true); @@ -157,26 +166,62 @@ void ofAddon::addReplaceStringVector(std::vector & variable, std::s } if(!addToVariable) variable.clear(); - Poco::RegularExpression regEX("(?<=\\$\\()[^\\)]*"); +// Poco::RegularExpression regEX("(?<=\\$\\()[^\\)]*"); + + //value : -F$(OF_ROOT)/addons/ofxSyphon/libs/Syphon/lib/osx/ + + //\$\(.+\) + //(?<=\$\().+(?=\)) // now with positive look behind and look ahead to get rid of $( and ) +// std::regex findVar("(?<=\\$\().+(?=\\))"); +// std::regex findVar("\\$\\(.+\\)"); +// (\$\()(.+)(\)) // now three capture groups here. we use only the second + std::regex findVar("(\\$\\()(.+)(\\))"); for(int i=0;i<(int)values.size();i++){ if(values[i]!=""){ - Poco::RegularExpression::Match match; - if(regEX.match(values[i],match)){ - string varName = values[i].substr(match.offset,match.length); - string varValue; - if(varName == "OF_ROOT"){ - varValue = pathToOF.string(); - }else if(getenv(varName.c_str())){ - varValue = getenv(varName.c_str()); + +// cout << values[i] << endl; +// cout << "----- VARMATCH" << endl; + std::smatch varMatch; + if(std::regex_search(values[i], varMatch, findVar)) { + if (varMatch.size() > 2) { +// cout << ">>> " << varMatch[2].str() << endl; + string varName = varMatch[2].str(); + string varValue; + if(varName == "OF_ROOT"){ + varValue = pathToOF.string(); + }else if(getenv(varName.c_str())){ + varValue = getenv(varName.c_str()); + } + ofStringReplace(values[i],"$("+varName+")",varValue); + ofLogVerbose("ofAddon") << "addon config: substituting " << varName << " with " << varValue << " = " << values[i] << endl; } - ofStringReplace(values[i],"$("+varName+")",varValue); - ofLogVerbose("ofAddon") << "addon config: substituting " << varName << " with " << varValue << " = " << values[i] << endl; } + +// cout << "----- POCO" << endl; +// Poco::RegularExpression::Match match; +// if(regEX.match(values[i],match)){ +// string varName = values[i].substr(match.offset,match.length); +// cout << "values[i] :: " << values[i] << endl; +// cout << "varName :: " << varName << endl; +// +// string varValue; +// if(varName == "OF_ROOT"){ +// varValue = pathToOF.string(); +// }else if(getenv(varName.c_str())){ +// varValue = getenv(varName.c_str()); +// } +// ofStringReplace(values[i],"$("+varName+")",varValue); +// ofLogVerbose("ofAddon") << "addon config: substituting " << varName << " with " << varValue << " = " << values[i] << endl; +// } if(prefix=="" || values[i].find(pathToOF.string())==0 || ofFilePath::isAbsolute(values[i])) variable.push_back(values[i]); else variable.push_back(ofFilePath::join(prefix,values[i])); } } +// cout << "___OUTPUT" << endl; +// for (auto & v : variable) { +// cout << v << endl; +// } } void ofAddon::addReplaceStringVector(vector & variable, string value, string prefix, bool addToVariable) { @@ -229,6 +274,10 @@ void ofAddon::parseVariableValue(string variable, string value, bool addToValue, if (!isLocalAddon) { // addonRelPath = ofFilePath::addTrailingSlash(pathToOF) + "addons/" + name; addonRelPath = pathToOF / "addons" / name; +// cout << "-----> this is not local addon" << endl; +// cout << pathToOF << endl; +// cout << addonRelPath << endl; + } else addonRelPath = addonPath; @@ -366,10 +415,8 @@ void ofAddon::exclude(vector & variables, vector exclusio void ofAddon::parseConfig(){ ofFile addonConfig; if(isLocalAddon){ - // addonConfig.open(ofFilePath::join(ofFilePath::join(pathToProject,addonPath),"addon_config.mk")); addonConfig.open(pathToProject / addonPath / "addon_config.mk"); }else{ - // addonConfig.open(ofFilePath::join(addonPath,"addon_config.mk")); addonConfig.open(addonPath / "addon_config.mk"); } @@ -414,8 +461,8 @@ void ofAddon::parseConfig(){ addToValue = false; varValue = splitStringOnceByLeft(line,"="); } - variable = Poco::trim(varValue[0]); - value = Poco::trim(varValue[1]); + variable = ofTrim(varValue[0]); + value = ofTrim(varValue[1]); if(!checkCorrectPlatform(currentParseState)){ continue; @@ -472,51 +519,62 @@ bool ofAddon::fromFS(of::filesystem::path path, const std::string & platform){ } auto srcPath = path / "src"; - ofLogVerbose() << "in fromFS, trying src " << srcPath; + if (ofDirectory(srcPath).exists()){ getFilesRecursively(srcPath, srcFiles); } - for(int i=0;i<(int)srcFiles.size();i++){ - srcFiles[i].erase(srcFiles[i].begin(), srcFiles[i].begin() + containedPath.string().length()); - int end = srcFiles[i].rfind(of::filesystem::path("/").make_preferred().string()); - int init = 0; - string folder; - if(!isLocalAddon){ - folder = srcFiles[i].substr(init,end); - }else{ - init = srcFiles[i].find(name); - folder = ofFilePath::join("local_addons", srcFiles[i].substr(init,end-init)); + // FIXME: srcFiles to fs::path + for (auto & s : srcFiles) { + of::filesystem::path folder; + if (isLocalAddon) { + // FIXME: test if local addons is working ok + folder = of::filesystem::path("local_addons") / of::filesystem::path(s).parent_path(); + } else { + folder = of::filesystem::path(s).parent_path(); + folder = of::filesystem::relative(folder, containedPath); } - srcFiles[i] = prefixPath.string() + srcFiles[i]; - filesToFolders[srcFiles[i]] = folder; + s = of::filesystem::path(prefixPath / of::filesystem::relative(s, containedPath)).string(); + filesToFolders[s] = folder.string(); } if (platform == "vs" || platform == "msys2") { getPropsRecursively(addonPath.string(), propsFiles, platform); } - - for (int i = 0; i < (int)propsFiles.size(); i++) { - propsFiles[i].erase(propsFiles[i].begin(), propsFiles[i].begin() + containedPath.string().length()); - int end = propsFiles[i].rfind(of::filesystem::path("/").make_preferred().string()); - int init = 0; - string folder; - if (!isLocalAddon) { - folder = propsFiles[i].substr(init, end); - } - else { - init = propsFiles[i].find(name); - folder = ofFilePath::join("local_addons", propsFiles[i].substr(init, end - init)); + + // FIXME: propsFiles to fs::path + for (auto & s : propsFiles) { + of::filesystem::path folder; + if (isLocalAddon) { + // FIXME: test if local addons is working ok + folder = of::filesystem::path("local_addons") / of::filesystem::path(s).parent_path(); + } else { + folder = of::filesystem::path(s).parent_path(); + folder = of::filesystem::relative(folder, containedPath); } - propsFiles[i] = prefixPath.string() + propsFiles[i]; - } + s = of::filesystem::path(prefixPath / of::filesystem::relative(s, containedPath)).string(); + } + +// for (int i = 0; i < (int)propsFiles.size(); i++) { +// propsFiles[i].erase(propsFiles[i].begin(), propsFiles[i].begin() + containedPath.string().length()); +// int end = propsFiles[i].rfind(of::filesystem::path("/").make_preferred().string()); +// int init = 0; +// string folder; +// if (!isLocalAddon) { +// folder = propsFiles[i].substr(init, end); +// } +// else { +// init = propsFiles[i].find(name); +// folder = ofFilePath::join("local_addons", propsFiles[i].substr(init, end - init)); +// } +// propsFiles[i] = prefixPath.string() + propsFiles[i]; +// } - string libsPath = ofFilePath::join(path, "/libs"); + of::filesystem::path libsPath = path / "libs"; vector < string > libFiles; - if (ofDirectory(libsPath).exists()){ getLibsRecursively(libsPath, libFiles, libs, platform); @@ -527,44 +585,42 @@ bool ofAddon::fromFS(of::filesystem::path path, const std::string & platform){ if(platform == "vs" || platform == "msys2"){ getDllsRecursively(libsPath, dllsToCopy, platform); } - } - - // I need to add libFiles to srcFiles - for (int i = 0; i < (int)libFiles.size(); i++){ - libFiles[i].erase (libFiles[i].begin(), libFiles[i].begin() + containedPath.string().length()); - //ofLogVerbose() << " libFiles " << libFiles[i]; - int init = 0; - int end = libFiles[i].rfind(of::filesystem::path("/").make_preferred().string()); - if (end > 0){ - string folder; - if (!isLocalAddon) { - folder = libFiles[i].substr(init, end); - } - else { - init = libFiles[i].find(name); - folder = ofFilePath::join("local_addons", libFiles[i].substr(init, end - init)); - } - libFiles[i] = prefixPath.string() + libFiles[i]; - srcFiles.push_back(libFiles[i]); - filesToFolders[libFiles[i]] = folder; + + for (auto & s : libFiles) { + of::filesystem::path folder; + if (isLocalAddon) { + // FIXME: test if local addons is working ok + folder = of::filesystem::path("local_addons") / of::filesystem::path(s).parent_path(); + } else { + folder = of::filesystem::path(s).parent_path(); + folder = of::filesystem::relative(folder, containedPath); } - + s = of::filesystem::path(prefixPath / of::filesystem::relative(s, containedPath)).string(); + srcFiles.emplace_back(s); + filesToFolders[s] = folder.string(); } - - - for (int i = 0; i < (int)libs.size(); i++){ - - // does libs[] have any path ? let's fix if so. - int end = libs[i].path.rfind(of::filesystem::path("/").make_preferred().string()); - if (end > 0){ - libs[i].path.erase (libs[i].path.begin(), libs[i].path.begin() + containedPath.string().length()); - libs[i].path = prefixPath.string() + libs[i].path; - } + // changing libs folder from absolute to relative. + for (auto & l : libs) { + l.path = of::filesystem::path(prefixPath / of::filesystem::relative(l.path, containedPath)).string(); } + + +// for (int i = 0; i < (int)libs.size(); i++){ +// +// cout << "libs path before " << libs[i].path << endl; +// // does libs[] have any path ? let's fix if so. +// int end = libs[i].path.rfind(of::filesystem::path("/").make_preferred().string()); +// if (end > 0){ +// libs[i].path.erase (libs[i].path.begin(), libs[i].path.begin() + containedPath.string().length()); +// libs[i].path = prefixPath.string() + libs[i].path; +// } +// cout << "libs path after " << libs[i].path << endl; +// +// } for (int i = 0; i < (int)frameworks.size(); i++){ @@ -605,24 +661,11 @@ bool ofAddon::fromFS(of::filesystem::path path, const std::string & platform){ filesToFolders[frameworks[i]] = folder; } - - - - } - - - - - - - // get a unique list of the paths that are needed for the includes. - list < string > paths; - for (int i = 0; i < (int)srcFiles.size(); i++){ - size_t found; - found = srcFiles[i].find_last_of(of::filesystem::path("/").make_preferred().string()); - paths.push_back(srcFiles[i].substr(0,found)); } + // paths that are needed for the includes. + list < of::filesystem::path > paths; + // get every folder in addon/src and addon/libs vector < string > libFolders; if(ofDirectory(libsPath).exists()){ @@ -631,25 +674,23 @@ bool ofAddon::fromFS(of::filesystem::path path, const std::string & platform){ vector < string > srcFolders; if(ofDirectory(srcPath).exists()){ - getFoldersRecursively(ofFilePath::join(path, "/src"), srcFolders, platform); + getFoldersRecursively(path / "src", srcFolders, platform); } - for (int i = 0; i < (int)libFolders.size(); i++){ - libFolders[i].erase (libFolders[i].begin(), libFolders[i].begin() + containedPath.string().length()); - libFolders[i] = prefixPath.string() + libFolders[i]; - paths.push_back(libFolders[i]); + // convert paths to relative + for (auto & l : libFolders) { + paths.push_back({ prefixPath / of::filesystem::relative(of::filesystem::path(l), containedPath) }); } - for (int i = 0; i < (int)srcFolders.size(); i++){ - srcFolders[i].erase (srcFolders[i].begin(), srcFolders[i].begin() + containedPath.string().length()); - srcFolders[i] = prefixPath.string() + srcFolders[i]; - paths.push_back(srcFolders[i]); + for (auto & l : srcFolders) { + paths.push_back({ prefixPath / of::filesystem::relative(of::filesystem::path(l), containedPath) }); } - paths.sort(); - paths.unique(); - for (list::iterator it=paths.begin(); it!=paths.end(); ++it){ - includePaths.push_back(*it); + paths.sort(); //paths.unique(); // unique not needed anymore. everything is carefully inserted now. + + for (auto & p : paths) { +// cout << p << endl; + includePaths.emplace_back(p.string()); } parseConfig(); @@ -657,37 +698,6 @@ bool ofAddon::fromFS(of::filesystem::path path, const std::string & platform){ return true; } -//void ofAddon::fromXML(string installXmlName){ -// clear(); -// pugi::xml_document doc; -// pugi::xml_parse_result result = doc.load_file(ofToDataPath(installXmlName).c_str()); - -// // this is src to add: -// pugi::xpath_node_set add = doc.select_nodes("//add/src/folder/file"); -// for (pugi::xpath_node_set::const_iterator it = add.begin(); it != add.end(); ++it){ -// pugi::xpath_node node = *it; -// //std::cout << "folder name " << node.node().parent().attribute("name").value() << " : "; -// //std::cout << "src: " << node.node().child_value() << endl; -// } - - -// add = doc.select_nodes("//include/path"); -// for (pugi::xpath_node_set::const_iterator it = add.begin(); it != add.end(); ++it){ -// pugi::xpath_node node = *it; -// //std::cout << "include: " << node.node().child_value() << endl; -// } - - -// add = doc.select_nodes("//link/lib[@compiler='codeblocks']"); -// // this has to be smarter I guess... -// for (pugi::xpath_node_set::const_iterator it = add.begin(); it != add.end(); ++it){ -// pugi::xpath_node node = *it; -// //std::cout << "link: " << node.node().child_value() << endl; -// } - - -//} - void ofAddon::clear(){ filesToFolders.clear(); diff --git a/ofxProjectGenerator/src/projects/CBLinuxProject.cpp b/ofxProjectGenerator/src/projects/CBLinuxProject.cpp index 1808fd09..e53d121d 100644 --- a/ofxProjectGenerator/src/projects/CBLinuxProject.cpp +++ b/ofxProjectGenerator/src/projects/CBLinuxProject.cpp @@ -72,8 +72,8 @@ bool CBLinuxProject::createProjectFile(){ if (relRoot != "../../../"){ std::string relPath2 = relRoot; relPath2.erase(relPath2.end()-1); - findandreplaceInTexfile(projectDir + "Makefile", "../../..", relPath2); - findandreplaceInTexfile(projectDir + "config.make", "../../..", relPath2); + findandreplaceInTexfile(projectDir / "Makefile", "../../..", relPath2); + findandreplaceInTexfile(projectDir / "config.make", "../../..", relPath2); findandreplaceInTexfile(ofFilePath::join(projectDir , projectName + ".workspace"), "../../../", relRoot); findandreplaceInTexfile(ofFilePath::join(projectDir , projectName + ".cbp"), "../../../", relRoot); } diff --git a/ofxProjectGenerator/src/projects/CBWinProject.cpp b/ofxProjectGenerator/src/projects/CBWinProject.cpp index cee2a882..bf67ba64 100644 --- a/ofxProjectGenerator/src/projects/CBWinProject.cpp +++ b/ofxProjectGenerator/src/projects/CBWinProject.cpp @@ -13,14 +13,14 @@ std::string CBWinProject::LOG_NAME = "CBWinProject"; bool CBWinProject::createProjectFile(){ - std::string project = projectDir + projectName + ".cbp"; - std::string workspace = projectDir + projectName + ".workspace"; + auto project = projectDir / (projectName + ".cbp"); + auto workspace = projectDir / (projectName + ".workspace"); ofFile::copyFromTo(ofFilePath::join(templatePath,"emptyExample.cbp"),project, false, true); ofFile::copyFromTo(ofFilePath::join(templatePath,"emptyExample.workspace"),workspace, false, true); - ofFile::copyFromTo(ofFilePath::join(templatePath,"icon.rc"), projectDir + "icon.rc", false, true); + ofFile::copyFromTo(ofFilePath::join(templatePath,"icon.rc"), projectDir / "icon.rc", false, true); //let's do some renaming: std::string relRoot = getOFRelPath(ofFilePath::removeTrailingSlash(projectDir)); @@ -48,7 +48,7 @@ bool CBWinProject::loadProjectFile(){ //project.open(ofFilePath::join(projectDir , projectName + ".cbp")); - ofFile project(projectDir + projectName + ".cbp"); + ofFile project(projectDir / (projectName + ".cbp")); if(!project.exists()){ ofLogError(LOG_NAME) << "error loading" << project.path() << "doesn't exist"; return false; @@ -67,7 +67,7 @@ bool CBWinProject::saveProjectFile(){ ofLogError(LOG_NAME) << "can't set title"; } } - return doc.save_file((projectDir + projectName + ".cbp").c_str()); + return doc.save_file((projectDir / (projectName + ".cbp")).c_str()); } void CBWinProject::addSrc(std::string srcName, std::string folder, SrcType type){ @@ -92,6 +92,6 @@ std::string CBWinProject::getName(){ return projectName; } -std::string CBWinProject::getPath(){ +of::filesystem::path CBWinProject::getPath(){ return projectDir; } diff --git a/ofxProjectGenerator/src/projects/CBWinProject.h b/ofxProjectGenerator/src/projects/CBWinProject.h index 36b45dca..167633b7 100644 --- a/ofxProjectGenerator/src/projects/CBWinProject.h +++ b/ofxProjectGenerator/src/projects/CBWinProject.h @@ -25,7 +25,7 @@ class CBWinProject: public baseProject { void addLibrary(const LibraryBinary & lib); std::string getName(); - std::string getPath(); + of::filesystem::path getPath(); static std::string LOG_NAME; diff --git a/ofxProjectGenerator/src/projects/baseProject.cpp b/ofxProjectGenerator/src/projects/baseProject.cpp index 8a2bdd43..8685a25a 100644 --- a/ofxProjectGenerator/src/projects/baseProject.cpp +++ b/ofxProjectGenerator/src/projects/baseProject.cpp @@ -109,17 +109,15 @@ vector baseProject::listAvailableTemplates(std::string ta return templates; } -// FIXME: substitute to of::filesystem -bool baseProject::create(string path, std::string templateName){ - cout << "baseProject::create " << path << endl; +bool baseProject::create(const of::filesystem::path & _path, std::string templateName){ templatePath = getPlatformTemplateDir(); addons.clear(); extSrcPaths.clear(); + auto path = _path; if(!ofFilePath::isAbsolute(path)){ path = (of::filesystem::current_path() / of::filesystem::path(path)).string(); } - // projectDir = ofFilePath::addTrailingSlash(path); projectDir = path; projectName = ofFilePath::getFileName(path); @@ -160,68 +158,39 @@ bool baseProject::create(string path, std::string templateName){ parseConfigMake(); if (bDoesDirExist){ + vector < string > fileNames; - getFilesRecursively(ofFilePath::join(projectDir , "src"), fileNames); - - for (int i = 0; i < (int)fileNames.size(); i++){ - - fileNames[i].erase(fileNames[i].begin(), fileNames[i].begin() + projectDir.length()); + getFilesRecursively(projectDir / "src", fileNames); - string first, last; -#ifdef TARGET_WIN32 - splitFromLast(fileNames[i], "\\", first, last); -#else - splitFromLast(fileNames[i], "/", first, last); -#endif - if (fileNames[i] != "src/ofApp.cpp" && - fileNames[i] != "src/ofApp.h" && - fileNames[i] != "src/main.cpp" && - fileNames[i] != "src/ofApp.mm" && - fileNames[i] != "src/main.mm"){ - addSrc(fileNames[i], first); + for (auto & f : fileNames) { + of::filesystem::path rel { of::filesystem::relative(f, projectDir) }; + of::filesystem::path folder { rel.parent_path() }; + + std::string fileName = rel.string(); + + if (fileName != "src/ofApp.cpp" && + fileName != "src/ofApp.h" && + fileName != "src/main.cpp" && + fileName != "src/ofApp.mm" && + fileName != "src/main.mm") { +// cout << "add filename:: " << rel << " :: " << folder << endl; + addSrc(rel.string(), folder.string()); + } else { +// cout << "not adding filename:: " << rel << " :: " << folder << endl; } } -// if( target == "ios" ){ -// getFilesRecursively(ofFilePath::join(projectDir , "bin/data"), fileNames); -// -// for (int i = 0; i < (int)fileNames.size(); i++){ -// fileNames[i].erase(fileNames[i].begin(), fileNames[i].begin() + projectDir.length()); -// -// string first, last; -// splitFromLast(fileNames[i], "/", first, last); -// if (fileNames[i] != "Default.png" && -// fileNames[i] != "src/ofApp.h" && -// fileNames[i] != "src/main.cpp" && -// fileNames[i] != "src/ofApp.mm" && -// fileNames[i] != "src/main.mm"){ -// addSrc(fileNames[i], first); -// } -// } -// } - - // get a unique list of the paths that are needed for the includes. - list < string > paths; - vector < string > includePaths; - for (int i = 0; i < (int)fileNames.size(); i++){ - size_t found; - #ifdef TARGET_WIN32 - found = fileNames[i].find_last_of("\\"); - #else - found = fileNames[i].find_last_of("/"); - #endif - paths.push_back(fileNames[i].substr(0,found)); - } - - paths.sort(); - paths.unique(); - for (list::iterator it=paths.begin(); it!=paths.end(); ++it){ - includePaths.push_back(*it); - } - - for (int i = 0; i < includePaths.size(); i++){ - addInclude(includePaths[i]); + // only add unique paths + std::vector < of::filesystem::path > paths; + for (auto & f : fileNames) { + auto dir = of::filesystem::path(f).parent_path().filename(); + if (std::find(paths.begin(), paths.end(), dir) == paths.end()) { + paths.emplace_back(dir); +// cout << "addInclude " << dir << endl; + addInclude(dir.string()); + } } + } return true; } @@ -277,7 +246,9 @@ bool baseProject::isAddonInCache(const std::string & addonPath, const std::strin void baseProject::addAddon(std::string addonName){ ofAddon addon; - addon.pathToOF = getOFRelPath(projectDir); +// cout << projectDir << endl; + addon.pathToOF = getOFRelPath(projectDir.string()); +// cout << addon.pathToOF << endl; addon.pathToProject = ofFilePath::getAbsolutePath(projectDir); auto localPath = ofFilePath::join(addon.pathToProject, addonName); @@ -383,7 +354,7 @@ void baseProject::addSrcRecursively(std::string srcPath){ std::map uniqueIncludeFolders; for( auto & fileToAdd : srcFilesToAdd){ - +// cout << "fileToAdd :: " << fileToAdd << endl; //if it is an absolute path it is easy - add the file and enclosing folder to the project if( ofFilePath::isAbsolute(fileToAdd) && !bMakeRelative ){ string folder = ofFilePath::getEnclosingDirectory(fileToAdd,false); @@ -427,6 +398,7 @@ void baseProject::addSrcRecursively(std::string srcPath){ folder = ofFilePath::removeTrailingSlash(folder); ofLogVerbose() << " adding file " << fileToAdd << " in folder " << folder << " to project "; + addSrc(relPathPathToAdd, folder); uniqueIncludeFolders[includeFolder] = includeFolder; } @@ -435,6 +407,7 @@ void baseProject::addSrcRecursively(std::string srcPath){ //do it this way so we don't try and add a include folder for each file ( as it checks if they are already added ) so should be faster for(auto & includeFolder : uniqueIncludeFolders){ ofLogVerbose() << " adding search include paths for folder " << includeFolder.second; + cout << "includeFolder.second " << includeFolder.second << endl; addInclude(includeFolder.second); } } diff --git a/ofxProjectGenerator/src/projects/baseProject.h b/ofxProjectGenerator/src/projects/baseProject.h index 2dca5ebf..b21dd726 100644 --- a/ofxProjectGenerator/src/projects/baseProject.h +++ b/ofxProjectGenerator/src/projects/baseProject.h @@ -39,7 +39,7 @@ class baseProject { virtual ~baseProject(){} - bool create(std::string path, std::string templateName=""); + bool create(const of::filesystem::path & path, std::string templateName=""); void parseAddons(); void parseConfigMake(); bool save(); @@ -70,7 +70,8 @@ class baseProject { virtual void addSrcRecursively(std::string srcPath); std::string getName() { return projectName;} - std::string getPath() { return projectDir; } +// std::string getPath() { return projectDir; } + of::filesystem::path getPath() { return projectDir; } std::vector