File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -328,13 +328,27 @@ set_variable_from_rel_or_absolute_path("docdir" "\\\${prefix}" "${CMAKE_INSTALL_
328328set_variable_from_rel_or_absolute_path("libdir" "\\\$ {prefix}" "${CMAKE_INSTALL_LIBDIR} " )
329329set_variable_from_rel_or_absolute_path("includedir" "\\\$ {prefix}" "${CMAKE_INSTALL_INCLUDEDIR} /${OPENJPEG_INSTALL_SUBDIR} " )
330330
331+ function (get_pkgconfig_deps NAME OUT)
332+ get_target_property (link_libs ${NAME} LINK_LIBRARIES )
333+ if (NOT link_libs STREQUAL "link_libs-NOTFOUND" )
334+ foreach (lib ${link_libs} )
335+ # omit -lopenjp2 from Libs.private because libopenjp2 is in Requires
336+ if (NOT ${lib} STREQUAL ${OPENJPEG_LIBRARY_NAME} )
337+ string (APPEND deps "-l${lib} " )
338+ endif ()
339+ endforeach ()
340+ endif ()
341+ set (${OUT} ${deps} PARENT_SCOPE)
342+ endfunction ()
343+ get_pkgconfig_deps(${OPENJPEG_LIBRARY_NAME} deps)
331344# install in lib and not share (CMAKE_INSTALL_LIBDIR takes care of it for multi-arch)
332345configure_file (${CMAKE_CURRENT_SOURCE_DIR} /src/lib/openjp2/libopenjp2.pc.cmake.in
333346 ${CMAKE_CURRENT_BINARY_DIR} /libopenjp2.pc @ONLY)
334347install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /libopenjp2.pc DESTINATION
335348 ${CMAKE_INSTALL_LIBDIR} /pkgconfig )
336349#
337350if (BUILD_JPIP)
351+ get_pkgconfig_deps(openjpip deps)
338352 configure_file (${CMAKE_CURRENT_SOURCE_DIR} /src/lib/openjpip/libopenjpip.pc.cmake.in
339353 ${CMAKE_CURRENT_BINARY_DIR} /libopenjpip.pc @ONLY)
340354 install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /libopenjpip.pc DESTINATION
Original file line number Diff line number Diff line change @@ -10,6 +10,6 @@ Description: JPEG2000 library (Part 1 and 2)
1010URL: http://www.openjpeg.org/
1111Version : @OPENJPEG_VERSION@
1212Libs: -L${libdir} -lopenjp2
13- Libs.private : -lm
13+ Libs.private : @deps@
1414Cflags: -I${includedir}
1515Cflags.private : -DOPJ_STATIC
Original file line number Diff line number Diff line change @@ -11,6 +11,6 @@ URL: http://www.openjpeg.org/
1111Version : @OPENJPEG_VERSION@
1212Requires: libopenjp2
1313Libs: -L${libdir} -lopenjpip
14- Libs.private : -lm -lcurl -lfcgi -lpthread
14+ Libs.private : @deps@
1515Cflags: -I${includedir}
1616Cflags.private : -DOPJ_STATIC
You can’t perform that action at this time.
0 commit comments