[bugfix] Make the cmake_guard command more stable
So far, the code failed when iterating over static data and cmake guard data in the wrong order (happens easily with python3)
So far, the code failed when iterating over static data and cmake guard data in the wrong order (happens easily with python3)