Had to add this couple of libraries in the CMakeLists.txt to be able to compile the executable with pylon5
GenApi_gcc_v3_0_Basler_pylon_v5_0
GCBase_gcc_v3_0_Basler_pylon_v5_0
Had a similar problem with pylon4 too, but not sure what are the libraries to add in that case.