Генерация файла для pkg-config вынесена в отдельную функцию
This commit is contained in:
parent
197e5b3939
commit
c73c31b380
@ -31,6 +31,7 @@ include(CMLibCotire)
|
|||||||
include(CMLibBuildTypes)
|
include(CMLibBuildTypes)
|
||||||
include(CMLibCommonTargetProperties)
|
include(CMLibCommonTargetProperties)
|
||||||
include(CMLibCommonLibraryTarget)
|
include(CMLibCommonLibraryTarget)
|
||||||
|
include(CMLibPkgConfig)
|
||||||
include(CMLibCodeAnalysisPvsStudio)
|
include(CMLibCodeAnalysisPvsStudio)
|
||||||
include(CMLibCodeAnalysisClangAnalyze)
|
include(CMLibCodeAnalysisClangAnalyze)
|
||||||
include(CMLibCodeAnalysisClangTidy)
|
include(CMLibCodeAnalysisClangTidy)
|
||||||
|
@ -35,7 +35,4 @@ function(add_common_library target)
|
|||||||
install(TARGETS ${target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS ${target}_static ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
endif()
|
endif()
|
||||||
# cmake-format: on
|
# cmake-format: on
|
||||||
|
|
||||||
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${target}.pc)
|
|
||||||
install(FILES ${CMAKE_BINARY_DIR}/${target}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
4
CMLibPkgConfig.cmake
Normal file
4
CMLibPkgConfig.cmake
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
function(generate_pkgconfig library_name)
|
||||||
|
configure_file(${CMLIB_MODULE_DIR}/pc/lib.pc.in ${CMAKE_BINARY_DIR}/${library_name}.pc)
|
||||||
|
install(FILES ${CMAKE_BINARY_DIR}/${library_name}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
|
endfunction()
|
@ -3,11 +3,11 @@ exec_prefix=@CMAKE_INSTALL_PREFIX@
|
|||||||
libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
|
libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
|
||||||
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
|
includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
|
||||||
|
|
||||||
Name: @current_target@
|
Name: @library_name@
|
||||||
Description: @current_target@ library
|
Description: @library_name@ library
|
||||||
Version: @PROJECT_VERSION@
|
Version: @PROJECT_VERSION@
|
||||||
|
|
||||||
Requires:
|
Requires:
|
||||||
Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@current_target@
|
Libs: -L@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@ -l@library_name@
|
||||||
Cflags: -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
|
Cflags: -I@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user