Skip to content

Commit

Permalink
Added pkg-config files
Browse files Browse the repository at this point in the history
varnam is accessible through pkg-config
  • Loading branch information
navaneeth committed Aug 30, 2013
1 parent f423006 commit c473707
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ CTestTestfile.cmake
cmake_install.cmake
tests/runtests
tests/testrun.log
varnam.pc
varnamstatic.pc
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ if (BUILD_TOOLS)
add_subdirectory(tools)
endif ()

# Generate pkg-config file
configure_file(varnam.pc.in varnam.pc @ONLY)
configure_file(varnamstatic.pc.in varnamstatic.pc @ONLY)

add_definitions(-DSQLITE_CASE_SENSITIVE_LIKE -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_FTS3_PARENTHESIS)

Expand All @@ -107,6 +110,8 @@ INSTALL ( TARGETS ${VARNAM_LIBRARY_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
INSTALL ( TARGETS ${VARNAM_LIBRARY_NAME_STATIC} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
INSTALL ( FILES ${VARNAM_INCLUDE_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lib${VARNAM_LIBRARY_NAME})
INSTALL ( FILES deps/sqlite3.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/lib${VARNAM_LIBRARY_NAME}/deps)
INSTALL ( FILES varnam.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
INSTALL ( FILES varnamstatic.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
INSTALL ( FILES ${vst_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/varnam/vst OPTIONAL)
INSTALL_PROGRAMS(/bin FILES varnamc varnamruby.rb)

Expand Down
8 changes: 7 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ In short, `libvarnam` can be initialized using `varnam_init()`. `varnam_init()`
Following example shows a simple usage of `libvarnam`.
```c
#include "varnam.h"
#include <varnam.h>
int main(int args, char **argv)
{
Expand Down Expand Up @@ -149,6 +149,12 @@ int main(int args, char **argv)
}
```
On a Linux machine, above example can be compiled using the following command:
```shell
gcc `pkg-config --cflags --libs varnam` -o example example.c
```
<a name="supported_languages" />
# Supported languages
Expand Down
11 changes: 11 additions & 0 deletions varnam.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/libvarnam

Name: Varnam
Description: A transliteration library for Indian languages
URL: http://varnamproject.com
Version: @VARNAM_VERSION_MAJOR@.@VARNAM_VERSION_MINOR@.@VARNAM_VERSION_PATCH@
Libs: -L${libdir} -lvarnam
Cflags: -I${includedir} -DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF -DNEED_ASPRINTF
11 changes: 11 additions & 0 deletions varnamstatic.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include/libvarnam

Name: Varnam (Static library)
Description: A transliteration library for Indian languages
URL: http://varnamproject.com
Version: @VARNAM_VERSION_MAJOR@.@VARNAM_VERSION_MINOR@.@VARNAM_VERSION_PATCH@
Libs: -L${libdir} -lvarnamstatic
Cflags: -I${includedir} -DHAVE_SNPRINTF -DPREFER_PORTABLE_SNPRINTF -DNEED_ASPRINTF

0 comments on commit c473707

Please sign in to comment.