This error appeared to me by adding a find_package(homemade_package)
in my CmakeLists.txr
In my case, this "homemade_package" relied on gazebo and rviz.
I don't know if my comment will be helpfull but, eliminating the packages that depended on gazebo and rviz fixed the problem for me.