You can find the ROS 2 official QNX build instructions here: https://ros2-qnx-documentation.readthedocs.io/en/latest/