/usr/share/dune/cmake/modules/DunePkgConfig.cmake is in libdune-common-dev 2.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # searches for pkg-config, creates the
# file <module-name>.pc from <module-name>.pc.in,
# and adds installation directives.
#
find_package(PkgConfig)
function(create_and_install_pkconfig installlibdir)
# set some variables that are used in the pkg-config file
include(GNUInstallDirs)
set( prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${installlibdir}")
set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
set(PACKAGE_NAME ${ProjectName})
set(VERSION ${ProjectVersion})
set(CC ${CMAKE_C_COMPILER})
set(CXX "${CMAKE_CXX_COMPILER} ${CXX_STD11_FLAGS}")
if(DUNE_DEPENDS)
foreach(_DUNE_DEPEND ${DUNE_DEPENDS})
string(REGEX REPLACE "\\(" "" REQF1 ${_DUNE_DEPEND})
string(REGEX REPLACE "\\)" "" LR ${REQF1})
if(REQUIRES)
set(REQUIRES "${REQUIRES} ${LR}")
else()
set(REQUIRES ${LR})
endif(REQUIRES)
endforeach(_DUNE_DEPEND ${DUNE_DEPENDS})
endif(DUNE_DEPENDS)
#create pkg-config file
configure_file(
${PROJECT_SOURCE_DIR}/${ProjectName}.pc.in
${PROJECT_BINARY_DIR}/${ProjectName}.pc
@ONLY
)
# install pkgconfig file
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${ProjectName}.pc
DESTINATION ${installlibdir}/pkgconfig)
endfunction(create_and_install_pkconfig)
|