Skip to content

Commit

Permalink
Add basic pkg-config .pc file
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme committed Jun 14, 2016
1 parent 90c7feb commit 33cc9fa
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
24 changes: 20 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,32 @@ configure_file(
${PROJECT_SOURCE_DIR}/caliper-config.h.in
${PROJECT_BINARY_DIR}/caliper-config.h)

# Make caliper findable
# Create pkg-confic .pc file
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
set(PKG_CONFIG_LIBS "-L\${libdir} -lcaliper")
set(PKG_CONFIG_CFLAGS "-I\${includedir}")

configure_file(
${PROJECT_SOURCE_DIR}/caliper.pc.in
${PROJECT_BINARY_DIR}/caliper.pc)

# Make caliper findable for cmake
configure_file(
${PROJECT_SOURCE_DIR}/caliper-config.cmake.in
${PROJECT_BINARY_DIR}/caliper-config.cmake
@ONLY)
install(FILES ${PROJECT_BINARY_DIR}/caliper-config.cmake DESTINATION share/cmake/caliper)
install(EXPORT caliper DESTINATION share/cmake/caliper)

install(FILES ${PROJECT_BINARY_DIR}/caliper-config.cmake
DESTINATION share/cmake/caliper)
install(EXPORT caliper
DESTINATION share/cmake/caliper)

install(FILES ${PROJECT_BINARY_DIR}/caliper-config.h
DESTINATION include/caliper)

install(FILES ${PROJECT_BINARY_DIR}/caliper-config.h DESTINATION include/caliper)
install(FILES ${PROJECT_BINARY_DIR}/caliper.pc
DESTINATION lib/pkgconfig)

add_subdirectory(doc)
add_subdirectory(src)
Expand Down
8 changes: 8 additions & 0 deletions caliper.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Name: ${PROJECT_NAME}
Description: Caliper is a generic context annotation system.
Version: ${CALIPER_VERSION}
prefix=${CMAKE_INSTALL_PREFIX}
includedir=${PKG_CONFIG_INCLUDEDIR}
libdir=${PKG_CONFIG_LIBDIR}
Libs: ${PKG_CONFIG_LIBS}
Cflags: ${PKG_CONFIG_CFLAGS}

0 comments on commit 33cc9fa

Please sign in to comment.