Actually `ublox_msgs_EXPORTED_TARGETS` is always define and non-empty if the package contains messages. Only if you use the aggregated variable `catkin_EXPORTED_TARGETS` which might be empty you need to check it.