Правка работы с PkgConfig

This commit is contained in:
Andrei Astafev 2021-12-24 15:09:01 +03:00
parent 178412c505
commit c82b5f29f1
2 changed files with 8 additions and 8 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
project(myx-cmake VERSION 0.4.2 LANGUAGES)
project(myx-cmake VERSION 0.4.4 LANGUAGES)
include(GNUInstallDirs)
file(WRITE ${CMAKE_SOURCE_DIR}/MyxCMake/MyxCMakeConfigVersion.cmake

View File

@ -16,27 +16,27 @@ function(myx_cmake_generate_pkgconfig target)
get_target_property(__target_type ${target} TYPE)
if(__target_type STREQUAL INTERFACE_LIBRARY)
file(
WRITE "${CMAKE_BINARY_DIR}/${BASENAME}.pc"
WRITE "${CMAKE_BINARY_DIR}/${ARG_BASENAME}.pc"
"prefix=${CMAKE_INSTALL_PREFIX}\n"
"exec_prefix=${CMAKE_INSTALL_PREFIX}\n"
"includedir=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}\n"
"\n"
"Name: ${BASENAME}\n"
"Description: ${BASENAME} header-only library\n"
"Name: ${ARG_BASENAME}\n"
"Description: ${ARG_BASENAME} header-only library\n"
"Version: ${PROJECT_VERSION}\n"
"\n"
"Requires:\n"
"Cflags: -I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}\n")
else()
file(
WRITE "${CMAKE_BINARY_DIR}/${BASENAME}.pc"
WRITE "${CMAKE_BINARY_DIR}/${ARG_BASENAME}.pc"
"prefix=${CMAKE_INSTALL_PREFIX}\n"
"exec_prefix=${CMAKE_INSTALL_PREFIX}\n"
"libdir=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\n"
"includedir=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}\n"
"\n"
"Name: ${BASENAME}\n"
"Description: ${BASENAME} library\n"
"Name: ${ARG_BASENAME}\n"
"Description: ${ARG_BASENAME} library\n"
"Version: ${PROJECT_VERSION}\n"
"\n"
"Requires:\n"
@ -44,7 +44,7 @@ function(myx_cmake_generate_pkgconfig target)
"Cflags: -I${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}\n")
endif()
install(
FILES "${CMAKE_BINARY_DIR}/${BASENAME}.pc"
FILES "${CMAKE_BINARY_DIR}/${ARG_BASENAME}.pc"
COMPONENT ${ARG_COMPONENT}
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
endfunction()