From a3f51ecf22d0fb837f591a20b470a2933c3533e5 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Wed, 17 May 2023 01:50:47 -0700 Subject: [PATCH] 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 --- CMakeLists.txt | 1 + cmake/ftxui_install.cmake | 10 ++++++++++ ftxui.pc.in | 9 +++++++++ 3 files changed, 20 insertions(+) create mode 100644 ftxui.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt index c52c339..c0794c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.11) project(ftxui LANGUAGES CXX VERSION 4.0.0 + DESCRIPTION "C++ Functional Terminal User Interface." ) option(FTXUI_BUILD_DOCS "Set to ON to build docs" ON) diff --git a/cmake/ftxui_install.cmake b/cmake/ftxui_install.cmake index 19e68d0..605841d 100644 --- a/cmake/ftxui_install.cmake +++ b/cmake/ftxui_install.cmake @@ -11,6 +11,7 @@ install(TARGETS screen dom component install(DIRECTORY include/ftxui DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) +# CMake package configuration for easy use of library in CMake include(CMakePackageConfigHelpers) configure_package_config_file(ftxui-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ftxui-config.cmake @@ -31,3 +32,12 @@ install(EXPORT ftxui-export NAMESPACE 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 +) diff --git a/ftxui.pc.in b/ftxui.pc.in new file mode 100644 index 0000000..73ecb1b --- /dev/null +++ b/ftxui.pc.in @@ -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