Skip to content

Instantly share code, notes, and snippets.

@frgomes
Last active March 25, 2021 04:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frgomes/af11fa0b8e4eb895a98e7822f7ebf508 to your computer and use it in GitHub Desktop.
Save frgomes/af11fa0b8e4eb895a98e7822f7ebf508 to your computer and use it in GitHub Desktop.
bash - run cmake out of tree / run cmake out of project

Instead of running cmake in tree such as:

cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt

cd wabt
mkdir build
cd build
cmake ..
cmake --build .
cmake --install ${HOME}/tools/wabt

You can build from any other directory, like this:

cd ${WORKSPACE}
git clone http://github.com/WebAssembly/wabt

cd /tmp

cmake "${WORKSPACE}/wabt" -B "${WORKSPACE}/wabt/build"
cmake --build "${WORKSPACE}/wabt/build"
cmake --install "${WORKSPACE}/wabt/build" --prefix "${HOME}/tools/wabt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment