Repository: pytorch
Issue: The Python module installs cmake files and headers under the Python's site-packages directory that can't be used
Labels: module: build,module: cpp,triaged

### 🐛 Describe the bug

These cmake files can't be found by cmake because cmake doesn't look in this location:
```
        /usr/local/lib/python3.9/site-packages/torch/include/c10/macros/cmake_macros.h
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/ATen/ATenConfig.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Config.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Targets-release.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Caffe2Targets.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/FindCUDAToolkit.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/FindCUSPARSELT.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/FindCUDA.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/FindCUDNN.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/CMakeInitializeConfigs.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/make2cmake.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/parse_cubin.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/run_nvcc.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindCUDA/select_compute_arch.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindPackageHandleStandardArgs.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/Modules_CUDA_fix/upstream/FindPackageMessage.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/LoadHIP.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/cuda.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/gflags.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/glog.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/mkl.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/mkldnn.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/protobuf.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Caffe2/public/utils.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfig.cmake
        /usr/local/lib/python3.9/site-packages/torch/share/cmake/Torch/TorchConfigVersion.cmake
        etc.
```

Likewise, these headers are also can't be easily found:
```
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_flatten.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_layouts.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_list.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_memoryformats.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_new.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_numpy.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_qschemes.h
        /usr/local/lib/python3.9/site-packages/torch/include/torch/csrc/utils/tensor_types.h
        etc.
```

In order to satisfy the [C++ API](https://pytorch.org/cppdocs/) cmake files, headers and libraries should normally be installed under $PREFIX, for example under /usr/local/include, /usr/local/lib, etc.

They are actually properly installed when the cmake build is performed separately.
So there is no need to install them with the Python module into the above paths.

### Versions

n/a

cc @malfet @seemethere @jbschlosser