[cmake] Collect python packages and run poetry add just once.
Collects python packages to install during the CMake-run in a temporary file and run poetry add
just once at the end. Speeds up CMake time a bit if you use poetry.
Edited by Lars Bilke