Skip to content

Commit

Permalink
update(cmake): Install libraries into CMAKE_INSTALL_LIBDIR
Browse files Browse the repository at this point in the history
Pull in and update a patch from Dima Kogan which installs libraries into
CMAKE_INSTALL_LIBDIR:

https://salsa.debian.org/debian/falcosecurity-libs/-/blob/master/debian/patches/fix-library-install-path.patch

This simplifies things when BUILD_SHARED_LIBS is enabled since it
reduces the need to mess with LD_LIBRARY_PATH or DYLD_LIBRARY_PATH.

Signed-off-by: Gerald Combs <gerald@wireshark.org>
  • Loading branch information
geraldcombs committed Oct 16, 2023
1 parent 03ab1bf commit d43eee1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmake/modules/libscap.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ string(REPLACE ";" " " LIBSCAP_LINK_LIBDIRS_FLAGS "${libscap_link_libdirs}")
configure_file(${LIBSCAP_DIR}/userspace/libscap/libscap.pc.in ${PROJECT_BINARY_DIR}/libscap/libscap.pc @ONLY)

install(TARGETS ${LIBSCAP_INSTALL_LIBS}
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT "scap" OPTIONAL)
install(DIRECTORY "${LIBSCAP_INCLUDE_DIR}" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}/userspace"
Expand Down
4 changes: 2 additions & 2 deletions cmake/modules/libsinsp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ endfunction()

add_subdirectory(${LIBSINSP_DIR}/userspace/libsinsp ${CMAKE_BINARY_DIR}/libsinsp)
install(TARGETS sinsp
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/${LIBS_PACKAGE_NAME}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT "sinsp")
install(DIRECTORY "${LIBSINSP_DIR}/userspace/libsinsp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${LIBS_PACKAGE_NAME}/userspace"
Expand Down
2 changes: 1 addition & 1 deletion userspace/libscap/libscap.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Name: libscap
Description: lib for System CAPture
Version: @FALCOSECURITY_LIBS_VERSION@

Libs: -L${libdir}/@LIBS_PACKAGE_NAME@ @LIBSCAP_LINK_LIBDIRS_FLAGS@ @LIBSCAP_LINK_LIBRARIES_FLAGS@
Libs: -L${libdir} @LIBSCAP_LINK_LIBDIRS_FLAGS@ @LIBSCAP_LINK_LIBRARIES_FLAGS@
Cflags: -I${includedir}/@LIBS_PACKAGE_NAME@/userspace/libscap
2 changes: 1 addition & 1 deletion userspace/libsinsp/libsinsp.pc.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ Description: lib for System INSPection
Version: @FALCOSECURITY_LIBS_VERSION@

Requires: libscap
Libs: -L${libdir}/@LIBS_PACKAGE_NAME@ -lsinsp @SINSP_PKG_CONFIG_LIBDIRS@ @SINSP_PKG_CONFIG_LIBS@
Libs: -L${libdir} -lsinsp @SINSP_PKG_CONFIG_LIBDIRS@ @SINSP_PKG_CONFIG_LIBS@
Cflags: -I${includedir}/@LIBS_PACKAGE_NAME@/userspace/libsinsp @SINSP_PKG_CONFIG_INCLUDES@

0 comments on commit d43eee1

Please sign in to comment.