Export to GitHub

openjpeg - issue #68

openjpeg2 pkg-config support


Posted on Mar 31, 2011 by Quick Monkey

Until now (31.03.2011) only one pkg-config file exists: openjpeg1.pc .

But OpenJPEG-1.4.0 may create three libraries: libopenjpeg.* libopenjpeg_JPWL.* libopenjp3dvm.*

So two pkg-config files are missing.

winfried

Comment #1

Posted on Jun 9, 2011 by Helpful Monkey

i think that there are still 2 missing .pc files, but it's for jpwl and jpip.

Btw, usually, in FOSS, they are named with a '-' and in lower case, like:

openjpeg-jpwl.pc

I'll send a patch

Vincent Torri

Comment #2

Posted on Jul 13, 2011 by Helpful Monkey

for 1.6 release

Comment #3

Posted on May 29, 2012 by Helpful Giraffe

(No comment was entered for this change.)

Comment #4

Posted on May 29, 2012 by Helpful Giraffe

(No comment was entered for this change.)

Comment #5

Posted on Nov 26, 2012 by Massive Rhino

OpenJPEG 2.0 does not include any pkg-config files at all. This makes it unnecessarily difficult for projects that do not use cmake to build against OpenJPEG.

Comment #6

Posted on Nov 26, 2012 by Grumpy Dog

sorry, this is on my plate to help implement... will try to make some progress this week.

Comment #7

Posted on Feb 21, 2013 by Grumpy Camel

This issue is causing me pain too. I maintain an image processing library which depends on openslide, which in turn depends on openjpeg. With no pkgconfig it's much harder than it should be for me to make Windows and OS X binaries.

I found this mail with a possible pkg-config.pc.cmake.in file:

https://groups.google.com/forum/?fromgroups=#!topic/openjpeg/arDqgbryCsg

I don't know if that helps.

Comment #8

Posted on Apr 19, 2013 by Happy Elephant

Hello,

The lack of pkg-config files prevents FFmpeg (or any softwares depending on openjpeg) from using openjpeg 2.0. It would be really great if you can fix this issue.

Thanks in advance.

Comment #9

Posted on Apr 19, 2013 by Grumpy Dog

Sorry for the delay... I'll try to make this a priority to work on soon

Comment #10

Posted on Apr 21, 2013 by Grumpy Elephant

There is a 'libopenjp2.pc' since looooong.

What is missing is a PC file for JPWL.

But is that necessary? When I know where the JP2 file is installed, then I know where the JPWL file is installed.

winfried

Comment #11

Posted on Jul 9, 2013 by Massive Rhino

It should be possible to run, for example, "pkg-config --libs openjpwl" to obtain the complete set of linker options needed to link with the library. Yes, it would be possible to run "pkg-config --variable=libdir libopenjp2" and use the output to construct the linker command line, but that's not how pkg-config is supposed to work.

Comment #12

Posted on Jul 10, 2013 by Grumpy Elephant

As the condition 'if(UNIX)' is not removed in the main CMakeLists.txt, the following changes in the main CMakeLists.txt are:

--- openjpeg-trunk-r2343-6/CMakeLists.txt.orig 2013-07-04 12:01:51.273904177 +0000 +++ openjpeg-trunk-r2343-6/CMakeLists.txt 2013-07-10 09:07:13.788122422 +0000 @@ -143,7 +143,7 @@ #----------------------------------------------------------------------------- # Big endian test: include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN) +TEST_BIG_ENDIAN(WORDS_BIGENDIAN)

#----------------------------------------------------------------------------- # Setup file for setting custom ctest vars @@ -314,5 +314,22 @@ ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpwl/libopenjpwl.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpip/libopenjpip.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp3d/libopenjp3d.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) endif() -#----------------------------------------------------------------------------- \ No newline at end of file +#-----------------------------------------------------------------------------

I propose the following *.pc.cmake.in files:

libopenjp2.pc.cmake.in:

prefix=@CMAKE_INSTALL_PREFIX@ bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@ includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@

Name: openjp2 Description: JPEG2000 library (Part 1 and 2) URL: http://www.openjpeg.org/ Version: @OPENJPEG_VERSION@ Libs: -L${libdir} -lopenjp2 Libs.private: -lm Cflags: -I${includedir}

libopenjp3d.pc.cmake.in:

prefix=@CMAKE_INSTALL_PREFIX@ bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@ includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@

Name: openjp3d Description: JPEG2000 Extensions for three-dimensional data (Part 10) URL: http://www.openjpeg.org/ Version: @OPENJPEG_VERSION@ Libs: -L${libdir} -lopenjp3d Libs.private: -lm Cflags: -I${includedir}

libopenjpip.pc.cmake.in:

prefix=@CMAKE_INSTALL_PREFIX@ bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@ includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@

Name: openjpip Description: JPEG2000 Interactivity tools, APIs and protocols (Part 9) URL: http://www.openjpeg.org/ Version: @OPENJPEG_VERSION@ Requires: openjp2, curl Requires.private: openjp2, curl Libs: -L${libdir} -lopenjpwl -lopenjp2 Libs.private: -lm -lopenjp2 -lcurl -lfcgi -lpthread Cflags: -I${includedir}

libopenjpwl.pc.cmake.in:

prefix=@CMAKE_INSTALL_PREFIX@ bindir=${prefix}/@OPENJPEG_INSTALL_BIN_DIR@ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@ includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@

Name: openjpwl Description: JPEG2000 Wireless library (Part 11) URL: http://www.openjpeg.org/ Version: @OPENJPEG_VERSION@ Libs: -L${libdir} -lopenjpwl -lopenjp2 Libs.private: -lm Cflags: -I${includedir}

Are the lines

Requires: openjp2, curl Requires.private: openjp2, curl

necessary for JPIP?

winfried

Comment #13

Posted on Jul 10, 2013 by Grumpy Elephant

The change in CMakeLists.txt is wrong. I added an earlier version of the diff file. The correct diff file is:

--- CMakeLists.txt.orig 2013-07-04 12:01:51.273904177 +0000 +++ CMakeLists.txt 2013-07-10 09:34:11.113281552 +0000 @@ -143,7 +143,7 @@ #----------------------------------------------------------------------------- # Big endian test: include (${CMAKE_ROOT}/Modules/TestBigEndian.cmake) -TEST_BIG_ENDIAN(OPJ_BIG_ENDIAN) +TEST_BIG_ENDIAN(WORDS_BIGENDIAN)

#----------------------------------------------------------------------------- # Setup file for setting custom ctest vars @@ -314,5 +314,29 @@ ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc @ONLY) install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp2.pc DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) +# + if(BUILD_JPWL) + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpwl/libopenjpwl.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpwl.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + endif() +# + if(BUILD_JPIP) + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjpip/libopenjpip.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjpip.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + endif() +# + if(BUILD_JP3D) + # install in lib and not share (see multi-arch note above) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/lib/openjp3d/libopenjp3d.pc.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc @ONLY) + install( FILES ${CMAKE_CURRENT_BINARY_DIR}/libopenjp3d.pc DESTINATION + ${OPENJPEG_INSTALL_LIB_DIR}/pkgconfig ) + endif() endif() -#----------------------------------------------------------------------------- \ No newline at end of file +#-----------------------------------------------------------------------------

winfried

Comment #14

Posted on Oct 15, 2013 by Grumpy Dog

working on it for real now. Thanks for the good start.

Comment #15

Posted on Oct 15, 2013 by Grumpy Dog

https://code.google.com/p/openjpeg/source/detail?r=2348

I suppose there is probably interest to backport this to branches/openjpeg-2.0 too?

Comment #16

Posted on Oct 28, 2013 by Grumpy Dog

Backported to branches/openjpeg-2.0 with https://code.google.com/p/openjpeg/source/detail?r=2349

Status: Fixed

Labels:
Type-Defect Priority-Medium Milestone-Release2.0