Installing ros-diagnostic_msgs should have thrown an error. There is no such packet. You need to install ros-<distro>-diagnostic-msgs (note the dashes instead of underscores, and the distro, for you this should be ros-indigo-diagnostic-msgs.
If the package you want to compile is set up correctly, you could also do a rosdep install <my_package> to automatically install the required packages.