aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-08 11:43:21 +0200
committerOlivier Tilloy <olivier.tilloy@canonical.com>2012-10-08 11:43:21 +0200
commit0186c4ae77edeeb5ccbb9fd889c2fae625cd9f13 (patch)
treef5b691b1ecd10d29e607d6b37f062f6fe0dc757b
parent1fec6fd6a8dc1b50098c62701416b149be57198f (diff)
downloadqmenumodel-0186c4ae77edeeb5ccbb9fd889c2fae625cd9f13.tar.gz
qmenumodel-0186c4ae77edeeb5ccbb9fd889c2fae625cd9f13.tar.bz2
qmenumodel-0186c4ae77edeeb5ccbb9fd889c2fae625cd9f13.zip
Add a pkgconfig file for developers.
-rw-r--r--.bzrignore1
-rw-r--r--CMakeLists.txt3
-rw-r--r--libqmenumodel/src/CMakeLists.txt18
-rw-r--r--libqmenumodel/src/qmenumodel.pc.in13
4 files changed, 30 insertions, 5 deletions
diff --git a/.bzrignore b/.bzrignore
index 46cf366..b81357f 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -7,6 +7,7 @@ cmake_install.cmake
install_manifest.txt
libqmenumodel/src/libqmenumodel.so*
+libqmenumodel/src/qmenumodel.pc
moc_*.cpp
*_automoc.cpp
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f51f637..261335a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,6 +2,9 @@ project(qmenumodel)
cmake_minimum_required(VERSION 2.8.9)
+# Standard install paths
+include(GNUInstallDirs)
+
find_package(Qt5Core REQUIRED)
include(FindPkgConfig)
pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
diff --git a/libqmenumodel/src/CMakeLists.txt b/libqmenumodel/src/CMakeLists.txt
index 435b412..e3d65a1 100644
--- a/libqmenumodel/src/CMakeLists.txt
+++ b/libqmenumodel/src/CMakeLists.txt
@@ -10,11 +10,12 @@ set(QMENUMODEL_SRC
qstateaction.cpp
)
-add_library(qmenumodel SHARED
+set(SHAREDLIBNAME qmenumodel)
+add_library(${SHAREDLIBNAME} SHARED
${QMENUMODEL_SRC}
)
-set_target_properties(qmenumodel PROPERTIES
+set_target_properties(${SHAREDLIBNAME} PROPERTIES
COMPILE_FLAGS -fPIC
SOVERSION 0
VERSION 0.1.1
@@ -24,9 +25,9 @@ include_directories(
${GLIB_INCLUDE_DIRS}
)
-qt5_use_modules(qmenumodel Core Widgets)
+qt5_use_modules(${SHAREDLIBNAME} Core Widgets)
-install(TARGETS qmenumodel LIBRARY DESTINATION lib${LIB_SUFFIX})
+install(TARGETS ${SHAREDLIBNAME} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
set(QMENUMODEL_HEADERS
dbus-enums.h
@@ -37,7 +38,14 @@ set(QMENUMODEL_HEADERS
qstateaction.h
)
+set(INCLUDEDIR qmenumodel)
install(FILES ${QMENUMODEL_HEADERS}
- DESTINATION include/qmenumodel
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${INCLUDEDIR}
+)
+
+set(PCFILE qmenumodel.pc)
+configure_file(${PCFILE}.in ${CMAKE_CURRENT_BINARY_DIR}/${PCFILE} @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PCFILE}
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)
diff --git a/libqmenumodel/src/qmenumodel.pc.in b/libqmenumodel/src/qmenumodel.pc.in
new file mode 100644
index 0000000..1c410bc
--- /dev/null
+++ b/libqmenumodel/src/qmenumodel.pc.in
@@ -0,0 +1,13 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=@CMAKE_INSTALL_PREFIX@
+libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+Name: qmenumodel
+Description: Qt binding for GMenuModel.
+Version: 0.1
+
+Requires.private: QtCore QtWidgets gio-2.0
+Libs: -L${libdir} -l@SHAREDLIBNAME@
+Cflags: -I${includedir}/@INCLUDEDIR@
+