My product foo is composed of a library: libfoo.so and an executable: foo, which depends on libfoo.so and on a third-party libbar.so.
I use CPack to get a RPM of foo which contains lib/libfoo.so and bin/foo.
But in the end I can't install the package: rpm -ivh complains about a needed dependency: libfoo.so.
I understand that automatic dependency resolution finds that foo needs libfoo.so but the purpose of installing the package is to provide that library.
If I disable automatic dependency resolution with CPACK_RPM_PACKAGE_AUTOREQ, the RPM looses libbar.so dependency as well.
How should I configure CPack in order to keep external dependencies but not internal ones?