Skip to content

Instantly share code, notes, and snippets.

@vittorioromeo
Created July 2, 2013 18:42
Show Gist options
  • Save vittorioromeo/5911924 to your computer and use it in GitHub Desktop.
Save vittorioromeo/5911924 to your computer and use it in GitHub Desktop.
Builds and installs both debug and release CMake configurations in all subfolders non-recursively
#!/bin/bash
echo "Password, please!"
sudo echo "Thanks!"
for dir in ./*; do
if [[ -d "$dir" ]]; then
(
cd "$dir"
mkdir "buildAll"
cd "buildAll"
mkdir "debug"
mkdir "release"
(cd "debug"; cmake ../../ -DCMAKE_BUILD_TYPE=DEBUG && make -j8 && sudo make install -j8)
(cd "release"; cmake ../../ -DCMAKE_BUILD_TYPE=RELEASE && make -j8 && sudo make install -j8)
)
fi
done
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment