Skip to content

Commit de8a2ef

Browse files
committed
Merge pull request #57 from openframeworks/localAddonsWork
allow for local addons to be specified via absolute paths
2 parents cd2792d + a7fd340 commit de8a2ef

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

ofxProjectGenerator/src/projects/baseProject.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,18 @@ void baseProject::addAddon(std::string addonName){
234234
ofAddon addon;
235235
addon.pathToOF = getOFRelPath(projectDir);
236236
addon.pathToProject = ofFilePath::getAbsolutePath(projectDir);
237+
238+
239+
237240
auto localPath = ofFilePath::join(addon.pathToProject, addonName);
238-
if(ofDirectory(localPath).exists()){
241+
242+
if (ofDirectory(addonName).exists()){
243+
// if it's an absolute path, convert to relative...
244+
string relativePath = ofFilePath::makeRelative(addon.pathToProject, addonName);
245+
addonName = relativePath;
246+
addon.isLocalAddon = true;
247+
addon.fromFS(addonName, target);
248+
} else if(ofDirectory(localPath).exists()){
239249
addon.isLocalAddon = true;
240250
addon.fromFS(addonName, target);
241251
}else{

0 commit comments

Comments
 (0)