[geos-devel] cmake detailed comments

Greg Troxel gdt at lexort.com
Fri Oct 15 06:02:19 PDT 2021


tl;dr:

I've done things the cmake way and the test are still not ok.
The problem is that the test RPATH is being *appended* to the BUILD
RPATH, instead of prepended.

long version:

My build script is:
----------------------------------------
#!/bin/sh

if [ -d $HOME/bin/ccache ]; then
    echo "enabling ccache"
    ccache -z
    PATH=$HOME/bin/ccache:$PATH
fi

PREFIX=/usr/pkg
LIBDIR=${PREFIX}/lib

# In theory, BSD make is ok.
MAKE=make 

(rm -rf build destdir &&
     mkdir build &&
     cd build &&
     cmake .. \
           -DCMAKE_INSTALL_PREFIX=${PREFIX} \
           -DCMAKE_BUILD_RPATH=${LIBDIR} \
           -DCMAKE_INSTALL_RPATH=${LIBDIR} \
           > OUT.00.cmake 2>&1 &&
     ${MAKE} > OUT.10.make 2>&1 &&
     (${MAKE} check > OUT.20.check 2>&1 || true) && \
     make DESTDIR=../destdir install > OUT.30.install 2>&1 && \
     echo BUILD DONE
)
----------------------------------------

BUILD_RPATH is passed because a packaging system invoking cmake must in
general ensure that programs/libs in the build environment can find
their dependencies at test time.

Some tests pass, and some fail, with "std:alloc bad" and various other
stuff.  But a quick look shows that objdump -x of one of the test
programs has:

  RPATH                /usr/pkg/lib:/home/n0/gdt/SOFTWARE/GEO/GEOS/geos-master/build/lib

so I expect it to go badly.   This should have been

  RPATH                /home/n0/gdt/SOFTWARE/GEO/GEOS/geos-master/build/lib:/usr/pkg/lib

and then I think it would have been fine.


If anyone can tell me what cmake args I should be using instead for the
general case of a program with a correct cmake setup and  which might be
finding dependencies from ${PREFIX}, I'd like to hear about it.   The
list above is what I came up after reading the cmake docs pointed out by
pramsey@ and strk at .

Greg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20211015/b5853212/attachment-0001.sig>


More information about the geos-devel mailing list