Skip to content

Commit 6e059da

Browse files
authored
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 <[email protected]>
1 parent 9bfa241 commit 6e059da

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.11)
33
project(ftxui
44
LANGUAGES CXX
55
VERSION 4.0.0
6+
DESCRIPTION "C++ Functional Terminal User Interface."
67
)
78

89
option(FTXUI_BUILD_DOCS "Set to ON to build docs" ON)

cmake/ftxui_install.cmake

+10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ install(TARGETS screen dom component
1111

1212
install(DIRECTORY include/ftxui DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
1313

14+
# CMake package configuration for easy use of library in CMake
1415
include(CMakePackageConfigHelpers)
1516
configure_package_config_file(ftxui-config.cmake.in
1617
${CMAKE_CURRENT_BINARY_DIR}/ftxui-config.cmake
@@ -31,3 +32,12 @@ install(EXPORT ftxui-export
3132
NAMESPACE ftxui::
3233
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
3334
)
35+
36+
# pkg-config file for easy use of library in build systems other than CMake
37+
configure_file(ftxui.pc.in
38+
${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc
39+
@ONLY)
40+
41+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc
42+
DESTINATION lib/pkgconfig
43+
)

ftxui.pc.in

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
prefix="@CMAKE_INSTALL_PREFIX@"
2+
libdir="@CMAKE_INSTALL_FULL_LIBDIR@"
3+
includedir="@CMAKE_INSTALL_FULL_INCLUDEDIR@"
4+
5+
Name: @PROJECT_NAME@
6+
Description: @CMAKE_PROJECT_DESCRIPTION@
7+
Version: @PROJECT_VERSION@
8+
Cflags: -I${includedir}
9+
Libs: -L${libdir} -lftxui-component -lftxui-dom -lftxui-screen

0 commit comments

Comments
 (0)