Move wireshark.pc.in and make our .pc file paths relative

Move the libwireshark pkgconfig file to the resource directory.

Set the various paths in our .pc files based on the `pcfiledir` variable
instead of using absolute paths. This should make it possible to install
using a DESTDIR that differs from CMAKE_INSTALL_PREFIX.
This commit is contained in:
Gerald Combs 2023-12-12 19:25:16 -08:00
parent c0bfd405b5
commit 107550c9c0
3 changed files with 12 additions and 18 deletions

View File

@ -1834,12 +1834,6 @@ configure_file(${CMAKE_SOURCE_DIR}/cmakeconfig.h.in ${CMAKE_BINARY_DIR}/config.h
configure_file(${CMAKE_SOURCE_DIR}/ws_version.h.in ${CMAKE_BINARY_DIR}/ws_version.h)
set( prefix "${CMAKE_INSTALL_PREFIX}" )
set( exec_prefix "\${prefix}" )
set( libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}" )
set( includedir "\${prefix}/include" )
set( plugindir "\${libdir}/wireshark/${PLUGIN_VERSION_DIR}" )
# Doxygen variables
file(GLOB TOP_LEVEL_SOURCE_LIST *.c *.cpp *.h)
string (REPLACE ";" " " DOXYGEN_TOP_LEVEL_SOURCES "${TOP_LEVEL_SOURCE_LIST}")
@ -1848,7 +1842,6 @@ set(DOXYGEN_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CFG_OUT_FILES
doxygen.cfg
epan/wireshark.pc
packaging/macosx/osx-app.sh
packaging/macosx/osx-dmg.sh
packaging/macosx/wireshark-app.dmgbuild
@ -1860,6 +1853,7 @@ set(CFG_OUT_FILES
resources/libwiretap.rc
resources/libwsutil.rc
resources/wireshark.exe.manifest
resources/wireshark.pc
resources/wireshark.rc
)
@ -4069,6 +4063,12 @@ if(BUILD_logray AND QT_FOUND AND NOT APPLE AND (NOT WIN32 OR USE_MSYSTEM))
RENAME org.wireshark.Logray.svg)
endif()
install(FILES "${CMAKE_BINARY_DIR}/resources/wireshark.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT "Development"
EXCLUDE_FROM_ALL
)
install(
DIRECTORY
${INSTALL_DIRS}

View File

@ -397,12 +397,6 @@ install(FILES ${LIBWIRESHARK_PUBLIC_HEADERS}
EXCLUDE_FROM_ALL
)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/wireshark.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT "Development"
EXCLUDE_FROM_ALL
)
add_executable(exntest EXCLUDE_FROM_ALL exntest.c except.c)
target_link_libraries(exntest epan)
set_target_properties(exntest PROPERTIES

View File

@ -1,9 +1,9 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
prefix=${pcfiledir}/../..
exec_prefix=${prefix}
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
sharedlibdir=${libdir}
plugindir=@plugindir@
plugindir=${libdir}/wireshark/@PLUGIN_VERSION_DIR@
Name: Wireshark
Description: Network Packet Dissection Library