[CMake] How to avoid the explicit library location when linking with imported library targets

Pere Mato Vila Pere.Mato at cern.ch
Fri Sep 17 18:49:59 EDT 2010


Hi Brad,

> This is why I was asking all those questions.  I bet the library
> has not been built with a proper SONAME field.

You are completely right, the library I was using to import has no SONAME field. I know exactly what I am doing wrong. I did build a proper library with the SONAME set with CMake and it generated by means of install(EXPORT) the proper property IMPORTED_SONAME_NOCONFIG "libGaudiKernel.so". Unfortunately, because of my stupidity the actual library I was importing when building the second project was still build with our old build system, which does not set the SONAME.  Therefore I understand now why CMake was confused and it was using the full path instead of -l.
I have trivially fixed the problem by using the proper libraries from CMake. Thanks very much for your patience.
Cheers,

Pere
 



More information about the CMake mailing list