Skip to content

Commit d3715a5

Browse files
committed
build: set SO version and generate pkg-config
1 parent 3c7e967 commit d3715a5

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,18 @@ install(
184184
DESTINATION ${VISP_LIB_INSTALL_DIR}/cmake/visioncpp
185185
)
186186

187+
if(PROJECT_IS_TOP_LEVEL AND VISP_STATIC_GGML)
188+
configure_file(
189+
scripts/pkg-config/visioncpp.pc.in
190+
${CMAKE_CURRENT_BINARY_DIR}/visioncpp.pc
191+
@ONLY
192+
)
193+
install(
194+
FILES ${CMAKE_CURRENT_BINARY_DIR}/visioncpp.pc
195+
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
196+
)
197+
endif()
198+
187199
# Packaging
188200

189201
if(PROJECT_IS_TOP_LEVEL)

scripts/pkg-config/visioncpp.pc.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
exec_prefix=${prefix}
3+
libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
4+
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
5+
6+
Name: visioncpp
7+
Description: Computer Vision ML inference in C++
8+
Version: @PROJECT_VERSION@
9+
Libs: -L${libdir} -lvisioncpp
10+
Cflags: -I${includedir}

src/visp/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ target_link_libraries(visioncpp
2828
PUBLIC ggml
2929
PRIVATE stb ${VISP_FMT_LINK}
3030
)
31-
# set_target_properties(visioncpp PROPERTIES
32-
# VERSION ${PROJECT_VERSION}
33-
# SOVERSION ${PROJECT_VERSION_MAJOR}
34-
# )
31+
set_target_properties(visioncpp PROPERTIES
32+
VERSION ${PROJECT_VERSION}
33+
SOVERSION ${PROJECT_VERSION_MAJOR}
34+
)
3535

3636
if (MSVC AND VISP_TESTS)
3737
set_target_properties(visioncpp PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)

0 commit comments

Comments
 (0)