Skip to content

Leverage cmake directory management and targets #49

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
22 changes: 9 additions & 13 deletions pico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,18 @@ cd $OUTDIR
source ~/.bashrc

# Build blink and hello world for pico and pico2
cd pico-examples
for board in pico pico2
do
# Build dirs will be outside of pico-* dirs
# so that it is not lost among all the subfolders
# of pico-examples
build_dir=build_$board
mkdir $build_dir
cd $build_dir
cmake ../ -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
for e in blink hello_world
do
echo "Building $e for $board"
cd $e
make -j$JNUM
cd ..
done

cd ..
if [ -d $build_dir ]; then
echo "$build_dir already exists so skipping"
else
cmake ./pico-examples -B $build_dir -DPICO_BOARD=$board -DCMAKE_BUILD_TYPE=Debug
cmake --build $build_dir --target blink hello_serial hello_usb
fi
done

cd $OUTDIR
Expand Down