Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenEXR.pc is not created during "configure" stage. #164

Closed
jdx-gh opened this issue Sep 27, 2015 · 2 comments
Closed

OpenEXR.pc is not created during "configure" stage. #164

jdx-gh opened this issue Sep 27, 2015 · 2 comments
Labels
Build A problem with building or installing the library.
Milestone

Comments

@jdx-gh
Copy link

jdx-gh commented Sep 27, 2015

The patch is based on suitable part of top level CMakeLists.txt from IlmBase-2.2.0.

--- /d/Works/openexr-2.2.0/CMakeLists.txt   2014-08-10 06:23:56 +0200
+++ /d/Works/openexr-2.2.0-new/CMakeLists.txt   2015-09-26 15:20:09 +0200
@@ -258,3 +258,23 @@
   DESTINATION
   ${CMAKE_INSTALL_PREFIX}/share/doc/OpenEXR-${OPENEXR_VERSION}/examples
   )
+
+# OpenEXR.pc
+FILE ( WRITE ${CMAKE_BINARY_DIR}/OpenEXR.pc "prefix=${CMAKE_INSTALL_PREFIX}\n" )
+FILE ( APPEND ${CMAKE_BINARY_DIR}/OpenEXR.pc "exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+OpenEXR_includedir=\${prefix}/include/OpenEXR
+
+Name: OpenEXR
+Description: OpenEXR library
+Version: ${OPENEXR_VERSION}
+Libs: -L\${libdir} -lIlmImfUtil${OPENEXR_LIBSUFFIX} -lIlmImf${OPENEXR_LIBSUFFIX} -lImath${ILMBASE_LIBSUFFIX} -lIexMath${ILMBASE_LIBSUFFIX} -lHalf -lIex${ILMBASE_LIBSUFFIX} -lIlmThread${ILMBASE_LIBSUFFIX} -pthread
+Cflags: -pthread -I\${OpenEXR_includedir}
+")
+
+INSTALL ( FILES
+  ${CMAKE_BINARY_DIR}/OpenEXR.pc
+  DESTINATION
+  lib/pkgconfig
+)
@ehanway-ilm ehanway-ilm added the Build A problem with building or installing the library. label Oct 24, 2015
@ehanway-ilm ehanway-ilm modified the milestone: v2.2.1 May 2, 2016
@dracwyrm
Copy link
Contributor

In PR #242 which switched everything over to GNUInstallDirs and also added the Libs.private line to the OpenEXR.pc file. This is the version I came up with, note: prefix and exec_prefix are not needed anymore.:

+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
 +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
 +OpenEXR_includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/OpenEXR
 +
 +Name: OpenEXR
 +Description: OpenEXR image library
 +Version: @OPENEXR_VERSION@
 +
 +Libs: -L${libdir} -lIlmImf@OPENEXR_LIBSUFFIX@ -lIlmImfUtil@OPENEXR_LIBSUFFIX@
 +Cflags: -I${OpenEXR_includedir}
 +Requires: IlmBase
 +Libs.private: -lz

Just thought I'd mention it here, as I hope GNUInstallDirs PR can be merged for 2.2.1.

@kdt3rd
Copy link
Contributor

kdt3rd commented Jul 17, 2019

A complete refactor of the cmake has taken place, modernizing cmake to match the "Modern CMake" guidelines and practices, and there is an option whether to generate pc files from cmake, and uses cmake configure_file to edit the *.pc.in to the desired install path, so this should be fixed in the next release we make (if you want to test the master branch, and report any issues, that would be awesome). Thanks for the report!

@kdt3rd kdt3rd closed this as completed Jul 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build A problem with building or installing the library.
Projects
None yet
Development

No branches or pull requests

5 participants