All files with .cpp or .c or .cc extensions are compiled... (let us say it is defined by U++ packages system). Dependency does not have any impact on this.
I suggest to use .hpp extension.
Custom build steps are still there, but are not helpful in this case.