However, when building an RPM, the share/cmake/ADH-APIS/ADH-APISTargets-release.cmake is not included in the rpm, which results in the mentioned error:
Can you provide a minimal project that reproduces your problem? It may be something about your system which causes RPM to behave differently, so having a minimal project that someone else can run on a different system may help to confirm that.
Thanks for your reply. I sat down and created the minimal example:
The issue is as described above: the package works when creating it via cmake --build build --target package but fails due to not including the fibTargets-release.cmake when build using cd build; cpack -G RPM -C CPackConfig.cmake
Thanks, that allowed me to track down the problem. You are invoking cpack incorrectly. The -C option expects a configuration name like Debug, Release, etc., not the name of a cpack configuration file. You don’t actually need to specify the file anyway, it will use CPackConfig.cmake by default. If you did need to specify a different file for some reason, the --config option is what you would use for that. It is unfortunate that the term “configuration” has multiple meanings here, but it is hard to avoid.