@glaringlee
As you can see from the second post I have already managed to generate the makefiles with cmake by adjusting the toolchain file with the following command:
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY BOTH)

Since I told cmake to search for libraries not only in the root of the target but also in the root of the host it was able to find the libtorch library. But the problem I have now is that the compiler shows error messages during the build process. Unfortunately I am not a programmer but a mechanical engineer working at a research lab of a german university trying to implement libtorch into production. So I am not sure what the compiler errors mean. I guess it is because of the stricter memory policies of QNX since it is an RTOS? But then I wonder why in the announcement videos where Libtorch and the C++ API were introduced, it was always said that the C++ API is specifically for production environments. The fact is that in production environments you mostly work with real-time operating systems like QNX or FreeRTOS.
Or is there a way to run Libtorch on an RTOS that I’m not aware of? The most important thing would be if at least pretrained models would run in realtime in the so-called online training.