Hei hei, 

On Wed, 14 Sep 2011 22:20:15 +0200, Michael Olbrich wrote:
>> I'll try this tomorrow. Meanwhile: do you have an idea, why it works
>> with different install prefixes in the native (non cross-compiling)
>> environment?
> 
> Does it work with any prefix? I think either the linker or cmake adds
> /usr/local/lib to the search path.

It does not work with any install prefix. What I tried was the
following. First I made sure no old files were installed to /usr or
/usr/local to not confuse cmake, compiler and linker. Then I built
libfoo like this:

$ cmake -DCMAKE_INSTALL_PREFIX=/home/adahl/usr ../../src/libfoo
$ make
$ make install

Ordinary out of source build with no problem at all because no
dependencies. Next step was building bar, which has a dependency to
libfoo like this:

$ cmake -DCMAKE_INSTALL_PREFIX=/home/adahl/usr ../../src/libfoo

At this point I checked cmake build variables with 'make edit_cache'
which showed the correct CMAKE_INSTALL_PREFIX and FOO_DIR was set to
/home/adahl/usr/lib/cmake/foo – apparently cmake also searches in
CMAKE_INSTALL_PREFIX for package configuration scripts.

$ make

This fails with the same error message like before:

  Linking C executable bar
  /usr/bin/ld: cannot find -lfoo
  collect2: ld returned 1 exit status

So it seems this is more a cmake problem, so maybe I should ask the
question again on the cmake mailing list?

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***

-- 
ptxdist mailing list
[email protected]

Reply via email to