Add the following line in the CMakeLists.txt
add_dependencies(<TARGET> ${${PROJECT_NAME}_EXPORTED_TARGETS} \${catkin_EXPORTED_TARGETS})

Where <TARGET> is the library or executable you want to build.