Skip to content

cmake: add curl library path#3925

Merged
pks-t merged 1 commit into
libgit2:masterfrom
pks-t:pks/cmake-library-dirs
Sep 9, 2016
Merged

cmake: add curl library path#3925
pks-t merged 1 commit into
libgit2:masterfrom
pks-t:pks/cmake-library-dirs

Conversation

@pks-t
Copy link
Copy Markdown
Member

@pks-t pks-t commented Sep 5, 2016

The PKG_CHECK_MODULES function searches a pkg-config module and
then proceeds to set various variables containing information on
how to link to the library. In contrast to the FIND_PACKAGE
function, the library path set by PKG_CHECK_MODULES will not
necessarily contain linking instructions with a complete path to
the library, though. So when a library is not installed in a
standard location, the linker might later fail due to being
unable to locate it.

While we already honor this when configuring libssh2 by adding
LIBSSH2_LIBRARY_DIRS to the link directories, we fail to do so
for libcurl, preventing us to build libgit2 on e.g. FreeBSD. Fix
the issue by adding the curl library directory to the linker
search path.

The `PKG_CHECK_MODULES` function searches a pkg-config module and
then proceeds to set various variables containing information on
how to link to the library. In contrast to the `FIND_PACKAGE`
function, the library path set by `PKG_CHECK_MODULES` will not
necessarily contain linking instructions with a complete path to
the library, though. So when a library is not installed in a
standard location, the linker might later fail due to being
unable to locate it.

While we already honor this when configuring libssh2 by adding
`LIBSSH2_LIBRARY_DIRS` to the link directories, we fail to do so
for libcurl, preventing us to build libgit2 on e.g. FreeBSD. Fix
the issue by adding the curl library directory to the linker
search path.
@pks-t pks-t merged commit bba704a into libgit2:master Sep 9, 2016
@pks-t pks-t deleted the pks/cmake-library-dirs branch October 10, 2016 07:03
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 this pull request may close these issues.

1 participant