From 0186c4ae77edeeb5ccbb9fd889c2fae625cd9f13 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Mon, 8 Oct 2012 11:43:21 +0200 Subject: Add a pkgconfig file for developers. --- .bzrignore | 1 + CMakeLists.txt | 3 +++ libqmenumodel/src/CMakeLists.txt | 18 +++++++++++++----- libqmenumodel/src/qmenumodel.pc.in | 13 +++++++++++++ 4 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 libqmenumodel/src/qmenumodel.pc.in 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@ + -- cgit v1.2.3