Skip to content

Commit

Permalink
pkgconfig libthai (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleoflqj authored Dec 30, 2023
1 parent e48583e commit bfef46c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions patches/libthai.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.22.1)
project(libthai)

include(GNUInstallDirs)

set(LIBTHAI_HEADER
"include/thai/thailib.h"
"include/thai/thcell.h"
Expand All @@ -17,3 +19,12 @@ add_library(thai STATIC ${LIBTHAI_SOURCE})
target_include_directories(thai PRIVATE include)
install(TARGETS thai)
install(FILES ${LIBTHAI_HEADER} DESTINATION include/thai)

configure_file(libthai.pc.in "${CMAKE_CURRENT_BINARY_DIR}/libthai.pc" @ONLY)

install(
FILES
"${CMAKE_CURRENT_BINARY_DIR}/libthai.pc"
DESTINATION
"${CMAKE_INSTALL_LIBDIR}/pkgconfig"
)
10 changes: 10 additions & 0 deletions patches/libthai.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

Name: libthai
Description: Thai support library
Version: @CMAKE_PROJECT_VERSION@
Cflags: -I${includedir}
Libs: -L${libdir} -lthai
1 change: 1 addition & 0 deletions scripts/libthai.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -e
cd libthai

cp ../patches/libthai.cmake CMakeLists.txt
cp ../patches/libthai.pc.in .
f5m_configure
f5m_build
f5m_install libthai
Expand Down

0 comments on commit bfef46c

Please sign in to comment.