Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@libdir@ pkg-config template substitution broken #68

Open
kiplingw opened this issue Jun 18, 2018 · 0 comments · May be fixed by #86
Open

@libdir@ pkg-config template substitution broken #68

kiplingw opened this issue Jun 18, 2018 · 0 comments · May be fixed by #86

Comments

@kiplingw
Copy link

kiplingw commented Jun 18, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant