That code will will not work when you buld your packages separately (which would happen if you release them to build Debians on the farm). You must check for existance of the target before using it in add_dependencies().

Furthermore your substitution of _gencpp with _generate_messages_cpp is wrong. In ublox_gps/CMakeLists.txt you should replace

    add_dependencies(ublox_gps ublox_msgs_gencpp)

with

    add_dependencies(ublox_gps ublox_msgs_generate_messages_cpp)