From a72dc4a75d02a789163bfeb05f5581add5c7a10c Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 28 Dec 2008 20:06:40 +0000 Subject: [PATCH] pkg-config support in CMakeLists.txt --- CMakeLists.txt | 13 +++++++++++++ libtorrent-rasterbar-cmake.pc.in | 6 ++++++ 2 files changed, 19 insertions(+) create mode 100644 libtorrent-rasterbar-cmake.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 9be4c2514..f975891c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,10 +192,23 @@ set_target_properties(torrent-rasterbar PROPERTIES SOVERSION 1 VERSION 1) +set (VERSION "0.15-svn") + +get_property (COMPILETIME_OPTIONS_LIST + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIRECTORY} + PROPERTY COMPILE_DEFINITIONS + ) +foreach (s ${COMPILETIME_OPTIONS_LIST}) + set (COMPILETIME_OPTIONS "${COMPILETIME_OPTIONS} -D${s}") +endforeach (s) + +configure_file(libtorrent-rasterbar-cmake.pc.in libtorrent-rasterbar.pc) + install(TARGETS torrent-rasterbar DESTINATION lib) install(DIRECTORY include/libtorrent DESTINATION include PATTERN ".svn" EXCLUDE) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libtorrent-rasterbar.pc DESTINATION lib/pkgconfig) # === build examples === if(build_examples) diff --git a/libtorrent-rasterbar-cmake.pc.in b/libtorrent-rasterbar-cmake.pc.in new file mode 100644 index 000000000..3af2b2ac5 --- /dev/null +++ b/libtorrent-rasterbar-cmake.pc.in @@ -0,0 +1,6 @@ +Name: libtorrent-rasterbar +Description: Bittorrent library. +Version: @VERSION@ +Libs: -L${CMAKE_INSTALL_PREFIX}/lib -ltorrent-rasterbar +Cflags: -I${CMAKE_INSTALL_PREFIX} -I${CMAKE_INSTALL_PREFIX}/libtorrent @COMPILETIME_OPTIONS@ @CPPFLAGS@ @CXX_DEFINES@ +