How to use cmake in a build hook


Sometimes a library may require cmake in order to compile. By default you only have make available. An example would be libgit2 how would you get this to work on ?


You will need:


1. Add at the beginning of your build hook in

Setting VERSION to the version of cmake you want.

export VERSION="3.16.0-rc4"
tar xzf cmake-$VERSION-Linux-x86_64.tar.gz
export PATH=$PATH:/$PWD/cmake-$VERSION-Linux-x86_64/bin

2. Potentially cleanup at the end of the build step if you don’t want cmake in production

rm -rf /$PWD/cmake-$VERSION-Linux-x86_64


Any dependencies that require cmake in their build should very probably work now.