add ${NL_LIBRARY_DIRS} to link_directories() #793
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Handles case where nl-route-3 and nl-3 libs are not installed in
a standard location. pkg_check_modules() puts the location it
got from pkgconfig in the NL_LIBRARY_DIRS variable.
For example, I have a test copy of nl-route-3 and nl-3 in /tmp/test/lib. There is no other version of these libs installed on my system. I can configure rdma-core with:
Without the fix, the compile will fail with:
because the "-L" linking information returned by pkg_check_modules() in ${NL_LIBRARY_DIRS} is ignored by the rdma-core CMakeLists.txt. This is easy to fix by adding a call to link_directories().
(an alternate solution if you are using cmake 3.6 or newer to use an imported target created by pkg_check_modules() with the "IMPORTED_TARGET" argument that got added in cmake 3.6)