Description: Configure and install pkg-config and cmake files for bzrtp
 Without this the build scripts try to install cmake files under
 /usr/share which causes multi-arch problems.
Author: Dennis Filder <d.filder@web.de>
Last-Updated: 2021-11-30
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,9 +114,17 @@
 	add_subdirectory(test)
 endif()
 
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${prefix}/bin)
+set(libdir ${prefix}/lib)
+set(includedir ${prefix}/include)
+set(PACKAGE_VERSION "${BZRTP_VERSION}")
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libbzrtp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libbzrtp.pc)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libbzrtp.pc DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
 
 include(CMakePackageConfigHelpers)
-set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/${PROJECT_NAME}/cmake")
+set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
 
 write_basic_package_version_file(
 	"${CMAKE_CURRENT_BINARY_DIR}/${EXPORT_TARGETS_NAME}ConfigVersion.cmake"
