Merge lp:~agateau/libdbusmenu-qt/cmake-config into lp:libdbusmenu-qt

Proposed by Aurélien Gâteau
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 252
Merged at revision: 251
Proposed branch: lp:~agateau/libdbusmenu-qt/cmake-config
Merge into: lp:libdbusmenu-qt
Diff against target: 119 lines (+43/-6)
6 files modified
CMakeLists.txt (+26/-1)
dbusmenu-qt-config.cmake.in (+5/-0)
debian/libdbusmenu-qt-dev.install (+1/-0)
debian/libdbusmenu-qt5-dev.install (+1/-0)
debian/rules (+2/-2)
src/CMakeLists.txt (+8/-3)
To merge this branch: bzr merge lp:~agateau/libdbusmenu-qt/cmake-config
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Sebastien Bacher Approve
Ted Gould (community) Approve
Review via email: mp+192895@code.launchpad.net

Description of the change

This change install CMake config files for dbusmenu-qt and dbusmenu-qt5. This makes it easy for other projects to use the library with find(dbusmenu-qt) or find(dbusmenu-qt5) without having to ship a FindDBusMenuQt.cmake file.

(More about this topic here: http://www.cmake.org/Wiki/CMake/Tutorials/Packaging ).

Test programs available here: http://agateau.com/tmp/dmqt-samples.tar.bz2

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

I'm a bit confused on why we'd want to ship a cmake fragment. It seems like the pkgconfig files already provide this type of interface for people using the library, no?

review: Needs Information
Revision history for this message
Aurélien Gâteau (agateau) wrote :

> I'm a bit confused on why we'd want to ship a cmake fragment. It seems like
> the pkgconfig files already provide this type of interface for people using
> the library, no?

The cmake config file is the cmake equivalent of pkgconfig files. It is easier to use from cmake than a pkgconfig file.

Revision history for this message
Ted Gould (ted) wrote :

Eh, sure. I'm not convinced it is that much easier, but I see no reason to not have it. CMake people are weird :-)

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Aurélien Gâteau (agateau) wrote :

> CMake people are weird :-)

Heh, yes, we can't help it :)

Landing failed because the new files are not in the -dev package, I am investigating the best way to do this.

252. By Aurélien Gâteau

Install .cmake files in relevant -dev packages, set build type

This patch defines the build type because if it is not set, we end up with
dbusmenu-qt*-targets-noconfig.cmake files instead of
dbusmenu-qt*-targets-relwithdebinfo.cmake

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Hey, can you push the button to force Jenkins to give the branch another try?

Revision history for this message
Sebastien Bacher (seb128) wrote :

(The CI infrastructure is being moved to a new location and down for some days, it should be back online later in the day)

Revision history for this message
Aurélien Gâteau (agateau) wrote :

Hi Sebastien! is the CI infrastructure back?

Revision history for this message
Sebastien Bacher (seb128) wrote :

hey, yes, not sure why it's not retrying this one, let me ask the CI crew ;-)

Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
http://jenkins.qa.ubuntu.com/job/libdbusmenu-qt-autolanding/11/
Executed test runs:
    SUCCESS: http://jenkins.qa.ubuntu.com/job/libdbusmenu-qt-trusty-amd64-autolanding/5
    SUCCESS: http://jenkins.qa.ubuntu.com/job/libdbusmenu-qt-trusty-armhf-autolanding/4
        deb: http://jenkins.qa.ubuntu.com/job/libdbusmenu-qt-trusty-armhf-autolanding/4/artifact/work/output/*zip*/output.zip

review: Needs Fixing (continuous-integration)
Revision history for this message
Sebastien Bacher (seb128) wrote :

ok, seems CI was happy this time, out of the revid thing ... trying to approve it then

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)
Revision history for this message
Aurélien Gâteau (agateau) wrote :

Thanks Sébastien!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-08-25 18:17:08 +0000
3+++ CMakeLists.txt 2013-11-12 13:32:30 +0000
4@@ -1,5 +1,5 @@
5 project(dbusmenu-qt)
6-cmake_minimum_required(VERSION 2.6.0)
7+cmake_minimum_required(VERSION 2.8.0)
8 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
9
10 # Build options
11@@ -57,8 +57,11 @@
12 set(QT_SUFFIX "qt")
13 endif()
14
15+include(CMakePackageConfigHelpers)
16 include(GNUInstallDirs)
17 set(LIB_DESTINATION "${CMAKE_INSTALL_LIBDIR}")
18+set(CMAKECONFIG_INSTALL_DIR "${LIB_DESTINATION}/cmake/dbusmenu-${QT_SUFFIX}")
19+set(INCLUDE_INSTALL_DIR "include/dbusmenu-${QT_SUFFIX}")
20
21 # dist targets
22 set(ARCHIVE_NAME libdbusmenu-${QT_SUFFIX}-${dbusmenu_qt_VERSION})
23@@ -103,3 +106,25 @@
24 DESTINATION share/doc/libdbusmenu-${QT_SUFFIX}-doc
25 )
26 endif(WITH_DOC)
27+
28+# Generate dbusmenu-qt-config* files
29+configure_package_config_file(
30+ dbusmenu-qt-config.cmake.in
31+ ${CMAKE_BINARY_DIR}/dbusmenu-${QT_SUFFIX}-config.cmake
32+ INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
33+ PATH_VARS INCLUDE_INSTALL_DIR
34+ )
35+
36+write_basic_package_version_file(
37+ ${CMAKE_BINARY_DIR}/dbusmenu-${QT_SUFFIX}-config-version.cmake
38+ VERSION ${dbusmenu_qt_VERSION}
39+ COMPATIBILITY SameMajorVersion
40+ )
41+
42+# Install dbusmenu-qt-config* files
43+install(FILES
44+ ${CMAKE_BINARY_DIR}/dbusmenu-${QT_SUFFIX}-config.cmake
45+ ${CMAKE_BINARY_DIR}/dbusmenu-${QT_SUFFIX}-config-version.cmake
46+ DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
47+ COMPONENT Devel
48+ )
49
50=== added file 'dbusmenu-qt-config.cmake.in'
51--- dbusmenu-qt-config.cmake.in 1970-01-01 00:00:00 +0000
52+++ dbusmenu-qt-config.cmake.in 2013-11-12 13:32:30 +0000
53@@ -0,0 +1,5 @@
54+@PACKAGE_INIT@
55+
56+include("${CMAKE_CURRENT_LIST_DIR}/dbusmenu-@QT_SUFFIX@-targets.cmake")
57+
58+set_and_check(dbusmenu-@QT_SUFFIX@_INCLUDE_DIRS "@PACKAGE_INCLUDE_INSTALL_DIR@")
59
60=== modified file 'debian/libdbusmenu-qt-dev.install'
61--- debian/libdbusmenu-qt-dev.install 2013-03-28 18:01:24 +0000
62+++ debian/libdbusmenu-qt-dev.install 2013-11-12 13:32:30 +0000
63@@ -1,3 +1,4 @@
64 usr/include/dbusmenu-qt/*
65 usr/lib/*/lib*-qt.so
66 usr/lib/*/pkgconfig/dbusmenu-qt.pc
67+usr/lib/*/cmake/dbusmenu-qt/*
68
69=== modified file 'debian/libdbusmenu-qt5-dev.install'
70--- debian/libdbusmenu-qt5-dev.install 2013-03-28 18:01:24 +0000
71+++ debian/libdbusmenu-qt5-dev.install 2013-11-12 13:32:30 +0000
72@@ -1,3 +1,4 @@
73 usr/include/dbusmenu-qt5/*
74 usr/lib/*/lib*-qt5.so
75 usr/lib/*/pkgconfig/dbusmenu-qt5.pc
76+usr/lib/*/cmake/dbusmenu-qt5/*
77
78=== modified file 'debian/rules'
79--- debian/rules 2013-05-02 15:32:36 +0000
80+++ debian/rules 2013-11-12 13:32:30 +0000
81@@ -11,8 +11,8 @@
82 override_dh_auto_configure:
83 mkdir qt4
84 mkdir qt5
85- cd qt4 && QT_SELECT=qt4 cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT4=true ../
86- cd qt5 && QT_SELECT=qt5 cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT5=true ../
87+ cd qt4 && QT_SELECT=qt4 cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT4=true -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
88+ cd qt5 && QT_SELECT=qt5 cmake -DCMAKE_INSTALL_PREFIX=/usr -DUSE_QT5=true -DCMAKE_BUILD_TYPE=RelWithDebInfo ../
89
90 override_dh_auto_build:
91 cd qt4 && make
92
93=== modified file 'src/CMakeLists.txt'
94--- src/CMakeLists.txt 2013-03-28 15:51:14 +0000
95+++ src/CMakeLists.txt 2013-11-12 13:32:30 +0000
96@@ -89,15 +89,20 @@
97 endif()
98
99 install(TARGETS dbusmenu-${QT_SUFFIX}
100+ EXPORT dbusmenu-${QT_SUFFIX}-targets
101 LIBRARY DESTINATION ${LIB_DESTINATION}
102- RUNTIME DESTINATION bin)
103+ RUNTIME DESTINATION bin
104+ )
105+
106+install(EXPORT dbusmenu-${QT_SUFFIX}-targets
107+ DESTINATION ${CMAKECONFIG_INSTALL_DIR})
108
109 install(DIRECTORY .
110- DESTINATION include/dbusmenu-${QT_SUFFIX}
111+ DESTINATION ${INCLUDE_INSTALL_DIR}
112 FILES_MATCHING PATTERN "*.h"
113 PATTERN "*_p.h" EXCLUDE
114 )
115
116 install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dbusmenu_version.h
117- DESTINATION include/dbusmenu-${QT_SUFFIX}
118+ DESTINATION ${INCLUDE_INSTALL_DIR}
119 )

Subscribers

People subscribed via source and target branches