pkgconfig: Fix support for absolute lib and include dirs
Using GNUInstallDirs to always have an absolute path regardless of the
user input:
MODIFY
CMakeLists.txt
CMakeLists.txt
@@ -273,22 +273,22 @@ endif()
# .so version
set_property(TARGET lcf PROPERTY SOVERSION 0)
+# installation
+include(GNUInstallDirs)
+
# pkg-config file generation
set(PACKAGE_TARNAME ${PROJECT_NAME})
set(PACKAGE_VERSION ${PROJECT_VERSION})
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\${prefix}")
-set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
-set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+set(libdir "${CMAKE_INSTALL_FULL_LIBDIR}")
+set(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}")
string(REPLACE ";" " " AX_PACKAGE_REQUIRES_PRIVATE "${LIBLCF_DEPS}")
configure_file(builds/${PROJECT_NAME}.pc.in builds/${PROJECT_NAME}.pc @ONLY)
# Cmake-config file generation
configure_file(builds/${PROJECT_NAME}-config.cmake.in builds/${PROJECT_NAME}-config.cmake @ONLY)
-# installation
-include(GNUInstallDirs)
-
install(
TARGETS lcf
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}

pkgconfig: Fix support for absolute lib and include dirs

Using GNUInstallDirs to always have an absolute path regardless of the
user input: https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html