From 5f61ec9305ba17cc414f0bd02d4f97234bc2c849 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Wed, 12 Sep 2018 21:09:17 +0800 Subject: Add QMatrixClient.pc.in --- CMakeLists.txt | 2 ++ QMatrixClient.pc.in | 10 ++++++++++ 2 files changed, 12 insertions(+) create mode 100644 QMatrixClient.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index fa48db03..8da079d8 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,4 @@ if (WIN32) endif (WIN32) install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/QMatrixClient.pc.in b/QMatrixClient.pc.in new file mode 100644 index 00000000..efd54b57 --- /dev/null +++ b/QMatrixClient.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} +includedir=@INCLUDE_INSTALL_DIR@ +libdir=@LIB_INSTALL_DIR@ + +Name: QMatrixClient +Description: A Qt5 library to write cross-platfrom clients for Matrix +Version: @API_VERSION@ +Cflags: -I${includedir} +Libs: -L${libdir} -lQMatrixClient -- cgit v1.2.3 From d4f67946169670bfd74037b8169ef1e315832c20 Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 13 Sep 2018 06:47:54 +0800 Subject: Use pkg-config only on GNU/Linux. --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8da079d8..be1541ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -190,4 +190,7 @@ if (WIN32) endif (WIN32) install(TARGETS qmc-example RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) + +if (UNIX AND NOT APPLE) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/QMatrixClient.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) +endif() -- cgit v1.2.3 From 966632bc5938c42cfb13a2f66976650141e24a9b Mon Sep 17 00:00:00 2001 From: Black Hat Date: Thu, 13 Sep 2018 07:47:08 +0800 Subject: Fix cdynamic linking issue of pkg-config. --- QMatrixClient.pc.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/QMatrixClient.pc.in b/QMatrixClient.pc.in index efd54b57..d2938ab7 100644 --- a/QMatrixClient.pc.in +++ b/QMatrixClient.pc.in @@ -1,7 +1,7 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix} -includedir=@INCLUDE_INSTALL_DIR@ -libdir=@LIB_INSTALL_DIR@ +includedir=${prefix}/include +libdir=${prefix}/lib Name: QMatrixClient Description: A Qt5 library to write cross-platfrom clients for Matrix -- cgit v1.2.3