Skip to content

Commit

Permalink
Merge pull request #510 from robUx4/cmake-pkgconfig
Browse files Browse the repository at this point in the history
cmake: export the necessary library in the pkg-config file
  • Loading branch information
sahlberg authored Dec 16, 2024
2 parents 115103c + c6b70a4 commit 7d881b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,14 @@ install(FILES cmake/FindNFS.cmake
DESTINATION ${INSTALL_CMAKE_DIR})

# handle pc-config files
set(PKG_LIBLIST "")
foreach(LIB ${SYSTEM_LIBRARIES})
if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB})
list(APPEND PKG_LIBLIST "${LIB}")
else()
list(APPEND PKG_LIBLIST "-l${LIB}")
endif()
endforeach()
configure_file(cmake/libnfs.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/libnfs.pc @ONLY)

Expand Down
2 changes: 1 addition & 1 deletion cmake/libnfs.pc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Description: libnfs is a client library for accessing NFS shares over a network.
Version: @PROJECT_VERSION@
Requires:
Conflicts:
Libs: -L${libdir} -lnfs
Libs: -L${libdir} -lnfs @PKG_LIBLIST@
Cflags: -I${includedir}

0 comments on commit 7d881b2

Please sign in to comment.