mirror of https://github.com/FreeRDP/FreeRDP
[cmake] generate relative pkgconfig path
generate the relative pkgconfig path from the actual install locations. fixes #9718
This commit is contained in:
parent
09c1269962
commit
f6a208f75e
|
@ -94,7 +94,7 @@ endif()
|
||||||
|
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-client.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-client.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-client${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
export(PACKAGE freerdp-client)
|
export(PACKAGE freerdp-client)
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,13 @@
|
||||||
option(PKG_CONFIG_RELOCATABLE "Generate relocatable pkg-config files" ON)
|
option(PKG_CONFIG_RELOCATABLE "Generate relocatable pkg-config files" ON)
|
||||||
if (PKG_CONFIG_RELOCATABLE)
|
if (PKG_CONFIG_RELOCATABLE)
|
||||||
set(PKG_CONFIG_INSTALL_PREFIX "\${pcfiledir}/../..")
|
file(RELATIVE_PATH PKG_CONFIG_INSTALL_REL ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig ${CMAKE_INSTALL_PREFIX})
|
||||||
|
if (PKG_CONFIG_INSTALL_REL MATCHES "/$")
|
||||||
|
string(LENGTH ${PKG_CONFIG_INSTALL_REL} PKG_CONFIG_INSTALL_REL_LEN)
|
||||||
|
math(EXPR PKG_CONFIG_INSTALL_REL_LEN "${PKG_CONFIG_INSTALL_REL_LEN} - 1")
|
||||||
|
string(SUBSTRING ${PKG_CONFIG_INSTALL_REL} 0 ${PKG_CONFIG_INSTALL_REL_LEN} PKG_CONFIG_INSTALL_REL)
|
||||||
|
endif()
|
||||||
|
set(PKG_CONFIG_INSTALL_PREFIX "\${pcfiledir}/${PKG_CONFIG_INSTALL_REL}")
|
||||||
else()
|
else()
|
||||||
set(PKG_CONFIG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
set(PKG_CONFIG_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
|
||||||
endif()
|
endif()
|
||||||
|
set(PKG_CONFIG_PC_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||||
|
|
|
@ -474,7 +474,7 @@ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "FreeRDP/libfreerdp")
|
||||||
|
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
## cmake project
|
## cmake project
|
||||||
export(PACKAGE freerdp)
|
export(PACKAGE freerdp)
|
||||||
|
|
|
@ -39,7 +39,7 @@ if (NOT RDTK_FORCE_STATIC_BUILD)
|
||||||
set(RDTK_INSTALL_INCLUDE_DIR ${RDTK_INCLUDE_DIR}/rdtk)
|
set(RDTK_INSTALL_INCLUDE_DIR ${RDTK_INCLUDE_DIR}/rdtk)
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc
|
${CMAKE_CURRENT_BINARY_DIR}/rdtk${RDTK_VERSION_MAJOR}.pc
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
install(FILES
|
install(FILES
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake
|
${CMAKE_CURRENT_BINARY_DIR}/rdtkConfig.cmake
|
||||||
|
|
|
@ -74,7 +74,7 @@ endforeach()
|
||||||
|
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-server.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-server.pc.in ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-server${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
export(PACKAGE freerdp-server)
|
export(PACKAGE freerdp-server)
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,7 @@ set_property(TARGET ${MODULE_NAME} PROPERTY FOLDER "Server/Proxy")
|
||||||
# pkg-config
|
# pkg-config
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-proxy.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-proxy.pc.in ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${MODULE_NAME}${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
export(PACKAGE freerdp-proxy)
|
export(PACKAGE freerdp-proxy)
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/freerdp-shadow.pc.in ${CMAKE_CURRENT_
|
||||||
configure_file(freerdp-shadow-cli.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1)
|
configure_file(freerdp-shadow-cli.1.in ${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1)
|
||||||
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1)
|
install_freerdp_man(${CMAKE_CURRENT_BINARY_DIR}/${MANPAGE_NAME}.1 1)
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/freerdp-shadow${FREERDP_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
export(PACKAGE freerdp-shadow)
|
export(PACKAGE freerdp-shadow)
|
||||||
|
|
||||||
|
|
|
@ -43,5 +43,5 @@ if (NOT UWAC_FORCE_STATIC_BUILD)
|
||||||
configure_file(uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
|
configure_file(uwac.pc.in ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc @ONLY)
|
||||||
|
|
||||||
set(UWAC_INSTALL_INCLUDE_DIR ${UWAC_INCLUDE_DIR}/uwac)
|
set(UWAC_INSTALL_INCLUDE_DIR ${UWAC_INCLUDE_DIR}/uwac)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/uwac${UWAC_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -366,4 +366,4 @@ install(EXPORT WinPRTargets DESTINATION ${WINPR_CMAKE_INSTALL_DIR})
|
||||||
|
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr${WINPR_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
|
@ -130,7 +130,7 @@ add_subdirectory(hash-cli)
|
||||||
|
|
||||||
include(pkg-config-install-prefix)
|
include(pkg-config-install-prefix)
|
||||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr-tools.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr-tools${WINPR_TOOLS_VERSION_MAJOR}.pc @ONLY)
|
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/winpr-tools.pc.in ${CMAKE_CURRENT_BINARY_DIR}/winpr-tools${WINPR_TOOLS_VERSION_MAJOR}.pc @ONLY)
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr-tools${WINPR_TOOLS_VERSION_MAJOR}.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/winpr-tools${WINPR_TOOLS_VERSION_MAJOR}.pc DESTINATION ${PKG_CONFIG_PC_INSTALL_DIR})
|
||||||
|
|
||||||
export(PACKAGE ${MODULE_NAME})
|
export(PACKAGE ${MODULE_NAME})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue