Skip to content

@libdir@ pkg-config template substitution broken #68

Open
@kiplingw

Description

@kiplingw

At configure time extras/CMakeLists.txt performs a template substitution of the pkg-config manfiest extras/curlpp.pc.in.

Trying to compile with g++ using the libcurlpp library fails with the following:

../libtool: line 7485: cd: lib/x86_64-linux-gnu: No such file or directory
libtool:   error: cannot determine absolute directory name of 'lib/x86_64-linux-gnu'
Makefile:808: recipe for target 'heliosd' failed

This is because the substitution variable for the library path @libdir@ is missing a leading forward slash:

$ pkg-config --libs curlpp 
-Llib/x86_64-linux-gnu -lcurlpp -Wl,-Bsymbolic-functions -Wl,-z,relro -lcur

This can be fixed by modifying CMakeList.txt's...
set(libdir "${CMAKE_INSTALL_LIBDIR}")

...to...
set(libdir "/${CMAKE_INSTALL_LIBDIR}")

I recommend the template look something like this:

# This is a comment
prefix=@prefix@
exec_prefix=${prefix}
includedir=${prefix}/include
libdir=${exec_prefix}/lib

Name: curlpp
Description: cURLpp is a libcurl C++ wrapper
Version:                            
Libs: -L${libdir} -lcurlpp -Wl,-Bsymbolic-functions -Wl,-z,relro
Cflags: -I{includedir}/
# libcurl is required as non-private because CurlHandle.inl uses curl_easy_setopt.
Requires: libcurl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions