I don't think its a problem with those libraries.
The scope INDI::FITSRecord is not found. Looks like this definition is missing in the headers that your build process found.
Did you check your cmake output for possible errors? Like in this:
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release ~/src/indi-3rdparty/libqhy
Maybe the build process is not pulling the right headers from the newly built indilib.
Before I did my build I completely removed all packages for INDI from my system so that I don't get any collisions with older stuff.
I would also recommend to install into /usr/local/ e.g. to prevent future problems with installed packages.