I am having issues with finding c-ares dependencies when building grpc in open-embedded.Error in the log when looking for the dependency c-ares during configure is shown in the log as -
--
Found ZLIB: ....../poky/build/tmp-glibc/sysroots/arm7/usr/lib/libz.so (found version "1.2.8")
CMake Error at ....../poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake:70 (message):
The imported target "c-ares::cares" references the file
"/usr/lib/libcares.so.2.2.0"
but this file does not exist. Possible reasons include:
* The file was deleted, renamed, or moved to another location.
* An install or uninstall procedure did not complete successfully.
* The installation package was faulty and contained
"/home/...../poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake"
but not all the files it references.
--
Issue seem to be how cmake has configured the import prefix for c-ares,which is configured as below in file - poky/build/tmp-glibc/sysroots/arm7/usr/lib/cmake/c-ares/c-ares-targets.cmake. I believe it should be the path into the target staging directory
set(_IMPORT_PREFIX "/usr")
Can someone please help me identify the issue here? what needs to be configured in the c-ares recipe in order to get the _IMPORT_PREFIX right?? Any help is much appreciated. Thanks
I came across this issue today when building a newer gRPC in an older (daisy) BitBake environment. The solutions I came to were either backporting this upstream change to the cmake.bbclass or hacking in the updated variable definitions in a .bbappend to the cmake invocation by way of the
EXTRA_OECMAKEvariable.I chose the latter, as I only seemed to need this for c-ares, and wanted to limit my impact. I did not end up digging into the difference between how c-ares and other gRPC dependencies (e.g. gflags) generate CMake export targets files. I assume there's some way the ultimate target paths are generated within the respective projects' CMakeLists.txt files.