Skip to content

Commit

Permalink
Add a pkg-config file
Browse files Browse the repository at this point in the history
  • Loading branch information
jstamp authored and lloyd committed Apr 29, 2011
1 parent 0e3dade commit eb62b54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ADD_DEFINITIONS(-DYAJL_BUILD)
# set up some paths
SET (libDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib)
SET (incDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/include/yajl)
SET (shareDir ${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/share/pkgconfig)

# set the output path for libraries
SET(LIBRARY_OUTPUT_PATH ${libDir})
Expand Down Expand Up @@ -58,7 +59,9 @@ FILE(MAKE_DIRECTORY ${libDir})
FILE(MAKE_DIRECTORY ${incDir})

# generate build-time source
SET(dollar $)
CONFIGURE_FILE(api/yajl_version.h.cmake ${incDir}/yajl_version.h)
CONFIGURE_FILE(yajl.pc.cmake ${shareDir}/yajl.pc)

# copy public headers to output directory
FOREACH (header ${PUB_HDRS})
Expand All @@ -79,4 +82,5 @@ IF(NOT WIN32)
INSTALL(TARGETS yajl_s ARCHIVE DESTINATION lib${LIB_SUFFIX})
INSTALL(FILES ${PUB_HDRS} DESTINATION include/yajl)
INSTALL(FILES ${incDir}/yajl_version.h DESTINATION include/yajl)
INSTALL(FILES ${shareDir}/yajl.pc DESTINATION share/pkgconfig)
ENDIF()
9 changes: 9 additions & 0 deletions src/yajl.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=${CMAKE_INSTALL_PREFIX}
libdir=${dollar}{prefix}/lib
includedir=${dollar}{prefix}/include/yajl

Name: Yet Another JSON Library
Description: A Portable JSON parsing and serialization library in ANSI C
Version: ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO}
Cflags: -I${dollar}{includedir}
Libs: -L${dollar}{libdir} -lyajl

0 comments on commit eb62b54

Please sign in to comment.