Skip to content

Commit

Permalink
cmake: Provide a pkgconfig file (#83)
Browse files Browse the repository at this point in the history
Fixes #80

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
  • Loading branch information
cryptomilk authored Mar 3, 2020
1 parent 847d2a7 commit ea1c68f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,8 @@ if(AVIF_BUILD_TESTS)
)
endif()

configure_file(libavif.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libavif.pc @ONLY)

if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install(TARGETS avif
EXPORT ${PROJECT_NAME}-config
Expand All @@ -336,6 +338,9 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
endif()

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libavif.pc
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL)
install(FILES include/avif/avif.h
Expand Down
10 changes: 10 additions & 0 deletions libavif.pc.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_FULL_PREFIX@
exec_prefix=${prefix}/bin
libdir=${prefix}/lib
includedir=${prefix}/include

Name: @PROJECT_NAME@
Description: Library for encoding and decoding .avif files
Version: @PROJECT_VERSION@
Libs: -L${libdir} -lavif
Cflags: -I{includedir}

0 comments on commit ea1c68f

Please sign in to comment.