You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
1.6 KiB

  1. From c4af9182efd9cbb127bb43486b55d9ddf4a521ca Mon Sep 17 00:00:00 2001
  2. From: Thomas Klausner <tk@giga.or.at>
  3. Date: Mon, 28 Jun 2021 11:52:15 +0200
  4. Subject: [PATCH] Try having relative paths in pkg-config file.
  5. Addresses #248
  6. ---
  7. CMakeLists.txt | 11 ++++++-----
  8. libzip.pc.in | 7 +++----
  9. 2 files changed, 9 insertions(+), 9 deletions(-)
  10. --- a/CMakeLists.txt
  11. +++ b/CMakeLists.txt
  12. @@ -281,11 +281,12 @@ endif()
  13. # pkgconfig file
  14. -set(prefix ${CMAKE_INSTALL_PREFIX})
  15. -set(exec_prefix \${prefix})
  16. -SET(bindir ${CMAKE_INSTALL_FULL_BINDIR})
  17. -SET(libdir ${CMAKE_INSTALL_FULL_LIBDIR})
  18. -SET(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
  19. +file(RELATIVE_PATH pc_relative_bindir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_BINDIR})
  20. +set(bindir "\${prefix}/${pc_relative_bindir}")
  21. +file(RELATIVE_PATH pc_relative_libdir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR})
  22. +set(libdir "\${prefix}/${pc_relative_libdir}")
  23. +file(RELATIVE_PATH pc_relative_includedir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_INCLUDEDIR})
  24. +set(includedir "\${prefix}/${pc_relative_includedir}")
  25. if(CMAKE_SYSTEM_NAME MATCHES BSD)
  26. set(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
  27. endif(CMAKE_SYSTEM_NAME MATCHES BSD)
  28. --- a/libzip.pc.in
  29. +++ b/libzip.pc.in
  30. @@ -1,10 +1,10 @@
  31. -prefix=@prefix@
  32. -exec_prefix=@exec_prefix@
  33. +prefix=@CMAKE_INSTALL_PREFIX@
  34. +exec_prefix=${prefix}
  35. bindir=@bindir@
  36. libdir=@libdir@
  37. includedir=@includedir@
  38. -zipcmp=@bindir@/zipcmp
  39. +zipcmp=${bindir}/zipcmp
  40. Name: libzip
  41. Description: library for handling zip archives
  42. @@ -12,4 +12,3 @@ Version: @PROJECT_VERSION@
  43. Libs: @PKG_CONFIG_RPATH@ -L${libdir} -lzip
  44. Libs.private: @LIBS@
  45. Cflags: -I${includedir}
  46. -