diff --git a/scripts/setup.sh b/scripts/setup.sh index 353cacd..d628173 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -269,11 +269,13 @@ find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/std::std::/s find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)unique_ptr\b/\1std::unique_ptr/g' {} + find src -type f \( -name "*.h" -o -name "*.cpp" \) -exec sed -i 's/\([^:a-zA-Z0-9]\)make_unique\b/\1std::make_unique/g' {} + -# Add memory header only if not present -find src -type f -name "*.h" -exec grep -q "" {} || sed -i '1i #include ' {} + - -# 3. Fix missing algorithms (std::find, etc) -find src -type f -name "*.cpp" -exec grep -q "" {} || sed -i '1i #include ' {} + +# Add headers only if not present +for f in $(find src -type f -name "*.h"); do + grep -q "" "$f" || sed -i '1i #include ' "$f" +done +for f in $(find src -type f -name "*.cpp"); do + grep -q "" "$f" || sed -i '1i #include ' "$f" +done # Build Example (Force C++17 for better compatibility with this addon) cd "$REAL_HOME/openFrameworks/addons/ofxPiMapper/example_basic"