Автоматическое создание файла для pkgconfig

This commit is contained in:
Andrei Astafev 2019-02-12 23:18:40 +03:00
parent 2a741e657f
commit 8dbf12ef43
2 changed files with 14 additions and 0 deletions

View File

@ -20,5 +20,6 @@ function(add_common_library LIBNAME SOURCES)
set_target_properties(${LIBNAME}_static PROPERTIES set_target_properties(${LIBNAME}_static PROPERTIES
OUTPUT_NAME ${LIBNAME} OUTPUT_NAME ${LIBNAME}
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR}) ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_INSTALL_LIBDIR})
configure_file(${CMAKE_SOURCE_DIR}/cmake/cmlib/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${LIBNAME}.pc)
endfunction() endfunction()

13
pc/lib.pc.in Normal file
View File

@ -0,0 +1,13 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
Name: @current_target@
Description: @current_target@ library
Version: @_ver@
Requires:
Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@current_target@
Cflags: -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@