Skip to content

Commit

Permalink
add pkgconfig (#3984)
Browse files Browse the repository at this point in the history
Signed-off-by: sodo <djdisodo@gmail.com>
  • Loading branch information
djdisodo committed Jul 4, 2022
1 parent c04a1bc commit 3b3605e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CMakeLists.txt
Expand Up @@ -513,9 +513,13 @@ if(NCNN_INSTALL_SDK)
install(EXPORT ncnn DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ncnn)
configure_file(${CMAKE_CURRENT_LIST_DIR}/../cmake/ncnnConfig.cmake.in ncnnConfig.cmake @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ncnnConfig.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ncnn)
# pkgconfig
configure_file(ncnn.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ncnn.pc @ONLY)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ncnn.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
endif()

# add ncnn and generate-spirv to a virtual project group
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(TARGET ncnn PROPERTY FOLDER "libncnn")
set_property(TARGET ncnn-generate-spirv PROPERTY FOLDER "libncnn")

11 changes: 11 additions & 0 deletions src/ncnn.pc.in
@@ -0,0 +1,11 @@
prefix=${pcfiledir}/../..
librarydir=${prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: @CMAKE_PROJECT_NAME@
Description: high-performance neural network inference framework optimized for the mobile platform
Version: @NCNN_VERSION_STRING@
URL: https://github.com/Tencent/ncnn
Libs: -L"${librarydir}" -lncnn
Cflags: -I"${includedir}"

0 comments on commit 3b3605e

Please sign in to comment.