Skip to content

Instantly share code, notes, and snippets.

@xiaodong2077
Last active July 26, 2024 08:00
Show Gist options
  • Save xiaodong2077/f4bf288f799556248fdd7d628967f1ca to your computer and use it in GitHub Desktop.
Save xiaodong2077/f4bf288f799556248fdd7d628967f1ca to your computer and use it in GitHub Desktop.
use stow to manage 3rd libraries

introduction

OS: Ubuntu 18.04, Ubuntu 20.04

Download stow from apt.

command lines

Replace xxx with the 3rd library you want to name.

git clone https://github.com/XXX/xxx.git
cd ./xxx/
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/stow/XXX -G Ninja ..
cmake --build . --config Release && sudo cmake --install .

cd /usr/local/stow
sudo stow xxx
cd /usr/local/stow
sudo stow -D xxx

Other

For me, I like to explicitly specify the version of the library. So I name the target directory xxx-{version}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment