[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 12:31:13 EDT 2010


Hi Brad,

   Thanks for your interest.  In fact your questions made me think in the direction that the problem must be in the way the library libGaudiKernel.so was built or installed. In fact I remembered that I have a soft link in the installation path. The directory /build/mato/GAUDI/GAUDI_v21r10p1 is a soft link to /build/mato/GAUDI/GAUDI_cmake and the library was actually installed in /build/mato/GAUDI/GAUDI_cmake/InstallArea/x86_64-slc5-gcc43-opt/lib. So if I change the path in the link statement then I do get the expected ldd output. 
  What I learn with this is that your claim that the install tree can be relocated to a new prefix and will still work is not true if this new location has a soft link. My original question remains valid. Why to use the absolute path for the imported library instead of using the -l?
  Thanks again.

Pere
 
-------------------------------------------------------------
Pere Mato  CERN, PH Department, CH 1211 Geneva 23, Switzerland
          e-mail: pere.mato at cern.ch      tel: +41 22 76 78696
          fax:  +41 22 76 68792            gsm: +41 76 48 70855




More information about the CMake mailing list