The link-test targets rebuilt every time you built the project because
that is the behavior of commands attached to add_custom_target. This is
fixed by combining add_custom_command and add_custom_target.
Fixing that led to a situation where the link-test targets built on the
first build, but didn't properly rebuild when their dependencies
changed. This is fixed by using set_source_file_properties to treat
test.cc as dirty when the test-install command runs.
this adds an install target which will install binaries, libraries, pkg-config and headers, along with a simple link-test program to verify the installed library and headers work.
---------
Co-authored-by: Joey Parrish <joeyparrish@google.com>