We use cmake to retrieve correct flags and dependencies that needed, the reason is that pytorch is changing very fast, the lib names, flags, dependencies keep changing. pkg-config is not easy to maintain here.