From 55aa9dd0e88a875e7caf4579739d560e7b7a2665 Mon Sep 17 00:00:00 2001 From: Emmanuel Bouthenot Date: Fri, 8 May 2009 23:37:13 +0200 Subject: [PATCH] Install developement files for plugins and pkg-config support (cmake). --- CMakeLists.txt | 14 ++++++++++++-- src/plugins/CMakeLists.txt | 2 ++ weechat.pc.in | 9 +++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 weechat.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index e96548621..aa835434c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,9 +31,10 @@ SET(VERSION_MINOR "2") SET(VERSION_PATCH "7-dev") SET(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}) SET(PKG_STRING "${PROJECT_NAME} ${VERSION}") -SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/weechat) -SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share/weechat) +SET(LIBDIR ${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}) +SET(SHAREDIR ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}) SET(LOCALEDIR ${CMAKE_INSTALL_PREFIX}/share/locale) +SET(INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}) STRING(REPLACE "\";\"" "\ " PKG_STRING ${PKG_STRING}) OPTION(DISABLE_NCURSES "Disable Ncurses interface") @@ -86,6 +87,15 @@ ADD_CUSTOM_TARGET(dist DEPENDS doc WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) +# pkgconfig file +SET(PACKAGE "${PROJECT_NAME}") +SET(prefix "${CMAKE_INSTALL_PREFIX}") +SET(exec_prefix "\${prefix}") +SET(libdir "\${exec_prefix}/lib") +SET(includedir "\${prefix}/include") +CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/weechat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc @ONLY) +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/weechat.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) + # packages SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Fast, light and extensible chat client") SET(CPACK_PACKAGE_VENDOR "FlashCode") diff --git a/src/plugins/CMakeLists.txt b/src/plugins/CMakeLists.txt index a35473cbb..c396b5327 100644 --- a/src/plugins/CMakeLists.txt +++ b/src/plugins/CMakeLists.txt @@ -85,3 +85,5 @@ ENDIF(ENABLE_TRIGGER) IF(NOT DISABLE_XFER) ADD_SUBDIRECTORY( xfer ) ENDIF(NOT DISABLE_XFER) + +INSTALL(FILES weechat-plugin.h DESTINATION ${INCLUDEDIR}) diff --git a/weechat.pc.in b/weechat.pc.in new file mode 100644 index 000000000..5fd1fd6ab --- /dev/null +++ b/weechat.pc.in @@ -0,0 +1,9 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: weechat +Description: Weechat plugins headers +Version: @VERSION@ +Cflags: -I${includedir}/@PACKAGE@