diff options
| author | Pekka Vuorela <pvuorela@iki.fi> | 2025-11-26 15:30:10 +0200 |
|---|---|---|
| committer | Pekka Vuorela <pvuorela@iki.fi> | 2025-12-02 09:26:10 +0200 |
| commit | 2781f486b27b80c0bf29bc9bc1a6bbf5b4d29431 (patch) | |
| tree | 4dd678b18a31f284c7e38e99e8f6b779402ba3ff | |
| parent | fce51980e885f5cb169dabaed91e9a7fdf08a762 (diff) | |
Create .pc files also on cmake build
Using extra-cmake-modules where the functionality can be gotten easily
without bigger overhaul on using the qt cmake module declarations more.
Result more or less similar to qmake build except here actually
marking the internal dependencies better. Using those to build
external code not tested but no much risk of regression when nothing
was offered on Qt6/cmake so far.
Change-Id: I02b422ac3cfe5f7b03b984ffc9e762082f9fd323
Reviewed-by: Pekka Vuorela <pvuorela@iki.fi>
Reviewed-by: Damien Caliste <dcaliste@free.fr>
| -rw-r--r-- | CMakeLists.txt | 10 | ||||
| -rw-r--r-- | src/libraries/qmfclient/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/libraries/qmfmessageserver/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/libraries/qmfwidgets/CMakeLists.txt | 8 |
4 files changed, 36 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 887b8f25..175ea82d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,6 +34,16 @@ if(BUILD_TESTING) endif() pkg_check_modules(ICU icu-i18n IMPORTED_TARGET) +# it might be possible to get this functionality from Qt cmake content but those seem buried there +# inside bigger modules +find_package(ECM NO_MODULE) +if (ECM_FOUND) + set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH}) + include(ECMGeneratePkgConfigFile) +else() + message("Extra-cmake-modules (ecm) not found, pkgconfig files won't be generated") +endif() + # there's probably some better compiler agnostic way to enable more warnings, but this is a start add_compile_options(-Wall -Wextra -Wpedantic) diff --git a/src/libraries/qmfclient/CMakeLists.txt b/src/libraries/qmfclient/CMakeLists.txt index 3b45c3f5..9eb339aa 100644 --- a/src/libraries/qmfclient/CMakeLists.txt +++ b/src/libraries/qmfclient/CMakeLists.txt @@ -176,3 +176,12 @@ install(TARGETS QmfClient if (TARGET Qt6::LinguistTools) qt_add_translations(libqmfclient) endif() + +if (ECM_FOUND) + ecm_generate_pkgconfig_file( + BASE_NAME QmfClient + INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/qt6/QmfClient + DEPS Qt6Core PRIVATE Qt6Core5Compat PRIVATE Qt6DBus PRIVATE Qt6Sql PRIVATE Qt6Network + URL "https://codereview.qt-project.org/gitweb?p=qt-labs%2Fmessagingframework.git" + INSTALL) +endif() diff --git a/src/libraries/qmfmessageserver/CMakeLists.txt b/src/libraries/qmfmessageserver/CMakeLists.txt index ba07da4e..8900a65a 100644 --- a/src/libraries/qmfmessageserver/CMakeLists.txt +++ b/src/libraries/qmfmessageserver/CMakeLists.txt @@ -40,3 +40,12 @@ set_target_properties(QmfMessageServer PROPERTIES install(TARGETS QmfMessageServer LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt6/QmfMessageServer) + +if (ECM_FOUND) + ecm_generate_pkgconfig_file( + BASE_NAME QmfMessageServer + INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/qt6/QmfMessageServer + DEPS Qt6Core QmfClient PRIVATE Qt6Network + URL "https://codereview.qt-project.org/gitweb?p=qt-labs%2Fmessagingframework.git" + INSTALL) +endif() diff --git a/src/libraries/qmfwidgets/CMakeLists.txt b/src/libraries/qmfwidgets/CMakeLists.txt index 88843c3c..88bcdb12 100644 --- a/src/libraries/qmfwidgets/CMakeLists.txt +++ b/src/libraries/qmfwidgets/CMakeLists.txt @@ -37,3 +37,11 @@ if (TARGET Qt6::LinguistTools) qt_add_translations(libqmfwidgets) endif() +if (ECM_FOUND) + ecm_generate_pkgconfig_file( + BASE_NAME QmfWidgets + INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}/qt6/QmfWidgets + DEPS Qt6Core Qt6Widgets QmfClient + URL "https://codereview.qt-project.org/gitweb?p=qt-labs%2Fmessagingframework.git" + INSTALL) +endif() |
