aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--QMatrixClient.pc.in10
2 files changed, 15 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa48db03..be1541ac 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,6 +147,7 @@ target_link_libraries(QMatrixClient Qt5::Core Qt5::Network Qt5::Gui)
add_executable(qmc-example ${example_SRCS})
target_link_libraries(qmc-example Qt5::Core QMatrixClient)
+configure_file(QMatrixClient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc @ONLY NEWLINE_STYLE UNIX)
# Installation
@@ -189,3 +190,7 @@ if (WIN32)
endif (WIN32)
install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+
+if (UNIX AND NOT APPLE)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+endif()
diff --git a/QMatrixClient.pc.in b/QMatrixClient.pc.in
new file mode 100644
index 00000000..d2938ab7
--- /dev/null
+++ b/QMatrixClient.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Name: QMatrixClient
+Description: A Qt5 library to write cross-platfrom clients for Matrix
+Version: @API_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lQMatrixClient