SIGN IN SIGN UP

Extend setup cmake ability (#3349)

Summary:
For executorch users, we see a common pattern that they have to:

```bash
bash install_requirements.sh --pybind xnnpack

cmake -S . -Bcmake-out ...

cmake --build ...
```

This is repeating cmake build twice, the first one is inside setup.py.

Here I'm adding a way to allow setup.py to install the libraries seperately, by passing `CMAKE_ARGS` and `CMAKE_BUILD_ARGS` into setup.py, through `install_requirements.sh`.

After this change, user can do:

```bash
export CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=<install dir> \
  -DEXECUTORCH_BUILD_OPTIMIZED=ON \
  ..."

export CMAKE_BUILD_ARGS="--target install"

bash install_requirements.sh --pybind xnnpack
```

Then we should be able to find `libxnnpack.a` `liboptimized_ops_lib.a` etc under install dir.

Pull Request resolved: https://github.com/pytorch/executorch/pull/3349

Reviewed By: mikekgfb

Differential Revision: D56560786

Pulled By: larryliu0820

fbshipit-source-id: fb6cd230df2317067f07ae0f1e72d0596b7b454b
M
Mengwei Liu committed
8ec0af9e78cfe027ca22fd6d9e207e92855d99c5
Parent: 319a4f2
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com> on 4/25/2024, 5:25:33 PM