There are several errors here: firstly, the arguments after NAMES will be considered alternative libraries for searching. Therefore, if he cannot find libboinc_api, he will try libboinc before the failure. Therefore, you should rather run FIND_LIBRARY twice, one for each library.
Secondly, you need to specify the name of the library, because it will be provided in the -l linker, that is, instead of libboinc_api, you just need to specify boinc_api or the full file name, as in the second attempt.
In the case of your initial attempt, cmake will try to find liblibboinc_api.so, liblibboinc_api.a, if there is no liblibboinc.so and finally liblibboinc.a.
Try the following:
FIND_LIBRARY(BOINC_LIBRARY_API NAMES boinc_api DOC "The Boinc API library") FIND_LIBRARY(BOINC_LIBRARY NAMES boinc DOC "The Boinc library")
Perhaps in the reverse order.
source share