Add pkg-config file. (#642)

This file describes the include and lib location and makes
it possible to use the library in build systems other than
CMake, e.g. in basic Makefiles.

Signed-off-by: Henner Zeller <h.zeller@acm.org>
This commit is contained in:
Henner Zeller 2023-05-17 01:50:47 -07:00 committed by GitHub
parent 9bfa241627
commit 6e059dadd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 0 deletions

View File

@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.11)
project(ftxui project(ftxui
LANGUAGES CXX LANGUAGES CXX
VERSION 4.0.0 VERSION 4.0.0
DESCRIPTION "C++ Functional Terminal User Interface."
) )
option(FTXUI_BUILD_DOCS "Set to ON to build docs" ON) option(FTXUI_BUILD_DOCS "Set to ON to build docs" ON)

View File

@ -11,6 +11,7 @@ install(TARGETS screen dom component
install(DIRECTORY include/ftxui DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) install(DIRECTORY include/ftxui DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
# CMake package configuration for easy use of library in CMake
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
configure_package_config_file(ftxui-config.cmake.in configure_package_config_file(ftxui-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/ftxui-config.cmake ${CMAKE_CURRENT_BINARY_DIR}/ftxui-config.cmake
@ -31,3 +32,12 @@ install(EXPORT ftxui-export
NAMESPACE ftxui:: NAMESPACE ftxui::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
) )
# pkg-config file for easy use of library in build systems other than CMake
configure_file(ftxui.pc.in
${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc
@ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc
DESTINATION lib/pkgconfig
)

9
ftxui.pc.in Normal file
View File

@ -0,0 +1,9 @@
prefix="@CMAKE_INSTALL_PREFIX@"
libdir="@CMAKE_INSTALL_FULL_LIBDIR@"
includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@"
Name: @PROJECT_NAME@
Description: @CMAKE_PROJECT_DESCRIPTION@
Version: @PROJECT_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lftxui-component -lftxui-dom -lftxui-screen