2020-04-22 19:05:17 +00:00
|
|
|
function(generate_pkgconfig library_name)
|
2020-04-22 19:25:22 +00:00
|
|
|
set(options)
|
|
|
|
set(oneValueArgs COMPONENT INSTALL_LIBRARY)
|
|
|
|
set(multiValueArgs)
|
|
|
|
|
|
|
|
cmake_parse_arguments(_PKG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
|
|
|
|
|
|
|
if(${_PKG_INSTALL_LIBRARY})
|
|
|
|
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${library_name}.pc)
|
|
|
|
else()
|
|
|
|
configure_file(${CMLIB_MODULE_DIR}/pc/lib-header-only.pc.in ${CMAKE_BINARY_DIR}/${library_name}.pc)
|
|
|
|
endif()
|
2020-04-24 17:35:57 +00:00
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/${library_name}.pc COMPONENT ${_PKG_COMPONENT}
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
2020-04-22 19:05:17 +00:00
|
|
|
endfunction()
|