pkg-config support in CMakeLists.txt

This commit is contained in:
Arvid Norberg 2008-12-28 20:06:40 +00:00
parent e21e05e493
commit a72dc4a75d
2 changed files with 19 additions and 0 deletions

View File

@ -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)

View File

@ -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@