I would recommend to follow this tutorial 105, which gives you a quick introduction to using libtorch.
As the tutorial and the error message explain, you should use:
root@fa350df05ecf:/home# mkdir build
root@fa350df05ecf:/home# cd build
root@fa350df05ecf:/home/build# cmake -DCMAKE_PREFIX_PATH=/path/to/libtorch ..

to build the application.