Add support for pkg_config#894
Add support for pkg_config#894gchatelet wants to merge 1 commit intoAcademySoftwareFoundation:masterfrom
Conversation
| # Write the file. | ||
| file ( WRITE ${CMAKE_BINARY_DIR}/OpenImageIO.pc "prefix=${CMAKE_INSTALL_PREFIX} | ||
| exec_prefix=\${prefix} | ||
| libdir=\${exec_prefix}/lib |
There was a problem hiding this comment.
Hardcoding 'lib' is a bad idea and would have to be patched by almost all distributions.
Use libdir=${CMAKE_INSTALL_FULL_LIBDIR} directly instead.
| file ( WRITE ${CMAKE_BINARY_DIR}/OpenImageIO.pc "prefix=${CMAKE_INSTALL_PREFIX} | ||
| exec_prefix=\${prefix} | ||
| libdir=\${exec_prefix}/lib | ||
| includedir=\${prefix}/include |
There was a problem hiding this comment.
same issue here, this shall be includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}
| exec_prefix=\${prefix} | ||
| libdir=\${exec_prefix}/lib | ||
| includedir=\${prefix}/include | ||
| OpenImageIO_includedir=\${prefix}/include/OpenImageIO |
There was a problem hiding this comment.
OpenImageIO_includedir=\${includedir}/OpenImageIO
| Requires: OpenEXR | ||
| ") | ||
| install (FILES ${CMAKE_BINARY_DIR}/OpenImageIO.pc DESTINATION lib/pkgconfig) | ||
| endif (OIIO_INSTALL_PKGCONFIG) |
| Cflags: -I\${OpenImageIO_includedir} | ||
| Requires: OpenEXR | ||
| ") | ||
| install (FILES ${CMAKE_BINARY_DIR}/OpenImageIO.pc DESTINATION lib/pkgconfig) |
There was a problem hiding this comment.
DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig
|
|
||
| Name: OpenImageIO | ||
| Description: OpenImageIO is an open source library for reading and writing image file formats, a nice format-agnostic image viewer, and other image-related classes and utilities. | ||
| Version: ${OIIO_VERSION_MAJOR}.${OIIO_VERSION_MINOR}.${OIIO_VERSION_PATCH} |
There was a problem hiding this comment.
You can use Version: ${OpenImageIO_VERSION} or Version: ${PROJECT_VERSION}
|
Thx for the review @krop but this PR is from 2014 and I moved on to other adventures in the meantime :) |
krop
left a comment
There was a problem hiding this comment.
review edited. CMAKE_INSTALL_FULL_* shall be preferred (you cannot guess whether relative or absolute paths are used when running CMake)
|
Oh, didn't look at the date, sorry. I was just looking at the opened ones :) |
|
No worries, and thx for taking the time to review. I'll close the PR then :) |
Add support for pkg_config to be consistent with ilmbase and openexr. I'm open to changes here since there are multiple options :
Also I'm adding all the libraries without paying attention to USE_xxx, this can be improved.