I found a solution : for some reasons the function
find_library(TORCH_LIBRARY torch PATHS “${TORCH_INSTALL_PREFIX}/lib”)
in the torchConfig.cmake file wasn’t working.
I just added
set(TORCH_LIBRARY, “${TORCH_INSTALL_PREFIX}/lib/libtorch.so”)
below and it worked like a charm.