From 2107f29fe38fe3a6425ed823ed4418d2a4309516 Mon Sep 17 00:00:00 2001 From: Markus Rickert Date: Tue, 1 Dec 2020 15:09:31 +0100 Subject: [PATCH] Generate relocatable pkgconfig file with CMake --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 70190906..735ce322 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -669,7 +669,9 @@ endif() install(FILES ${HDRS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ode COMPONENT development) -set(prefix ${CMAKE_INSTALL_PREFIX}) +file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig" "${CMAKE_INSTALL_PREFIX}") +string(REGEX REPLACE "/$" "" PACKAGE_RELATIVE_PATH "${PACKAGE_RELATIVE_PATH}") +set(prefix "\${pcfiledir}/${PACKAGE_RELATIVE_PATH}") set(exec_prefix "\${prefix}") set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}") set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") -- 2.11.4.GIT