Correct cmake flags passing (#18217)
Summary:
Fixes #18214.
According to the CMake manual, we should pass the arguments first, and put the directory as the last element. Otherwise, these flags may not be passed correctly.
Reference:
1. https://cmake.org/cmake/help/latest/manual/cmake.1.html#synopsis
2. https://stackoverflow.com/a/27169347
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18217
Differential Revision: D14540588
Pulled By: ezyang
fbshipit-source-id: a027f585dde66c5da7bbbe584fa42c3e56027d59