[test] Add CMAKE_GUARDs for PNM tests

Merged Kilian Weishaupt requested to merge fix/add_cmake_guards_pnm into master

Merge request reports