You need to add a build-time dependency between your package and the packages you depend on. Assuming the node you're trying to compile is called your_executable, try:
add_dependencies(your_executable \${catkin_EXPORTED_TARGETS})