cmake: make pkg-config package name independent of target name
This commit is contained in:
parent
a233d3cc28
commit
5c533522cb
|
@ -408,7 +408,7 @@ foreach (s ${COMPILETIME_OPTIONS_LIST})
|
|||
set (COMPILETIME_OPTIONS "${COMPILETIME_OPTIONS} -D${s}")
|
||||
endforeach (s)
|
||||
|
||||
generate_and_install_pkg_config_file(torrent-rasterbar)
|
||||
generate_and_install_pkg_config_file(torrent-rasterbar libtorrent-rasterbar)
|
||||
|
||||
install(TARGETS torrent-rasterbar EXPORT LibtorrentRasterbarTargets
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
|
|
@ -136,7 +136,7 @@ function(_expand_targets _targets _libraries_var _include_dirs_var _compile_opti
|
|||
endfunction()
|
||||
|
||||
# Generates and installs a pkg-config file for a given target
|
||||
function(generate_and_install_pkg_config_file _target)
|
||||
function(generate_and_install_pkg_config_file _target _packageName)
|
||||
# collect target properties
|
||||
_expand_targets(${_target}
|
||||
_interface_link_libraries _interface_include_dirs
|
||||
|
@ -147,6 +147,8 @@ function(generate_and_install_pkg_config_file _target)
|
|||
set(_output_name "${_target}")
|
||||
endif()
|
||||
|
||||
set(_package_name "${_packageName}")
|
||||
|
||||
# remove standard include directories
|
||||
foreach(d IN LISTS CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)
|
||||
list(REMOVE_ITEM _interface_include_dirs "${d}")
|
||||
|
|
|
@ -48,5 +48,5 @@ cmake_list_to_pkg_config(_interface_include_dirs "${_TARGET_INTERFACE_INCLUDE_DI
|
|||
set(_interface_compile_options "${_TARGET_INTERFACE_COMPILE_OPTIONS}")
|
||||
string(REPLACE ";" " " _interface_compile_options "${_interface_compile_options}")
|
||||
|
||||
configure_file("@_pkg_config_file_template_filename@" "@_generate_target_dir@/@_output_name@.pc" @ONLY)
|
||||
file(INSTALL "@_generate_target_dir@/@_output_name@.pc" DESTINATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig")
|
||||
configure_file("@_pkg_config_file_template_filename@" "@_generate_target_dir@/@_package_name@.pc" @ONLY)
|
||||
file(INSTALL "@_generate_target_dir@/@_package_name@.pc" DESTINATION "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/pkgconfig")
|
||||
|
|
Loading…
Reference in New Issue