Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: remove trailing slash for additional source folders and fix ofPath #382

Merged
merged 5 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions commandLine/src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#define PG_VERSION "PG v010"
#define PG_VERSION "PG v011"
#define TARGET_NO_SOUND
#define TARGET_NODISPLAY

Expand Down Expand Up @@ -272,8 +272,8 @@ void recursiveUpdate(const fs::path & path, ofTargetPlatform target) {
}
setOFRoot(ofPath);
fs::current_path(path);
alert ("ofRoot " + ofPath.string());
alert ("cwd " + path.string());
// alert ("ofRoot " + ofPath.string());
// alert ("cwd " + path.string());

updateProject(path, target, false);
}
Expand Down Expand Up @@ -405,9 +405,10 @@ int main(int argc, char** argv){
string srcString(options[SRCEXTERNAL].arg);
// TODO: TEST
for (auto & s : ofSplitString(srcString, ",", true, true)) {
s = ofFilePath::removeTrailingSlash(s);
srcPaths.emplace_back(s);
//alert ("additional src folder : " + s);
}
// srcPaths = ofSplitString(srcString, ",", true, true);
}
}

Expand Down
8 changes: 5 additions & 3 deletions commandLine/src/projects/baseProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,6 @@ void baseProject::addAddon(string addonName){
fixSlashOrder(addonName);
#endif



ofAddon addon;
// MARK: Review this path here. EDIT: I think it is finally good

Expand Down Expand Up @@ -357,6 +355,8 @@ void baseProject::addAddon(string addonName){
}

void baseProject::addSrcRecursively(const fs::path & srcPath){
ofLog() << "using additional source folder " << srcPath.string();
// alert("--");
// alert("addSrcRecursively " + srcPath.string());
fs::path base = srcPath.parent_path();
// alert("base = " + base.string());
Expand All @@ -367,10 +367,12 @@ void baseProject::addSrcRecursively(const fs::path & srcPath){
// bool isRelative = ofIsPathInPath(fs::absolute(srcPath), getOFRoot());

std::unordered_set<string> uniqueIncludeFolders;

for( auto & src : srcFilesToAdd){
fs::path parent = src.parent_path();
fs::path folder = parent.lexically_relative(base);
// alert ("addSrc " + src.string() + " : " + folder.string());

// alert ("addSrc file:" + src.string() + " -- folder:" + folder.string(), 35);
addSrc(src.string(), folder.string());
if (parent.string() != "") {
uniqueIncludeFolders.insert(parent.string());
Expand Down
11 changes: 9 additions & 2 deletions commandLine/src/projects/xcodeProject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ xcodeProject::xcodeProject(string target)
folderUUID = {
{ "src", "E4B69E1C0A3A1BDC003C02F2" },
{ "addons", "BB4B014C10F69532006C3DED" },
{ "openFrameworks", "191EF70929D778A400F35F26" },
// { "localAddons", "6948EE371B920CB800B5AC1A" },
{ "", "E4B69B4A0A3A1720003C02F2" }
};
Expand Down Expand Up @@ -127,10 +128,16 @@ bool xcodeProject::createProjectFile(){
}

// Calculate OF Root in relation to each project (recursively);
auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir);
fs::path relRoot { getOFRoot() };
if (ofIsPathInPath(fs::current_path(), getOFRoot())) {
auto relRoot = fs::relative((fs::current_path() / getOFRoot()), projectDir);
}



if (!fs::equivalent(relRoot, "../../..")) {
string root = relRoot.string();
alert ("root = " + root);
findandreplaceInTexfile(projectDir / (projectName + ".xcodeproj/project.pbxproj"), "../../..", root);
findandreplaceInTexfile(projectDir / "Project.xcconfig", "../../..", root);
if( target == "osx" ){
Expand Down Expand Up @@ -870,7 +877,7 @@ bool xcodeProject::saveProjectFile(){
}
}

// for (auto & c : commands) cout << c << endl
// for (auto & c : commands) cout << c << endl;

return true;
}
1 change: 1 addition & 0 deletions scripts/osx/buildPG.sh
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ if [[ $errorcode -ne 0 ]]; then
fi

# install electron sign globally
# sudo npx create-react-app electron-osx-sign
sudo npm install -g electron-osx-sign

if [ -d "/Users/runner/" ]; then
Expand Down