Commit Graph

7 Commits

Author SHA1 Message Date
Alex Richardson c6ceb84c22 Make OpenJPEGConfig.cmake relocatable with CMake > 3.0
Using CMakePackageConfigHelpers, we can generate a relocatable
OpenJPEGConfig.config, using the PATH_VARS feature to make
CMAKE_INSTALL_LIBDIR relative to the installed location.
This change is needed for me when cross-compiling since
CMAKE_INSTALL_FULL_LIBDIR is a path inside the sysroot rather than
an absolute path to the actual includes. Without this change poppler
ends up passing a -I flag that does not exist.

This includes fallback code for CMake 2.8, which adds a bit of complexity,
since I'm not sure if raising the minimum to 3.0 (now over 8 years old)
is acceptable.
2022-08-11 12:13:18 +00:00
Thomas Bracht Laumann Jespersen c7bccf0515
CMake: switch to GNUInstallDirs (#1424)
* Add GNUInstallDirs for standard installation directories

Distributions are given standard variables for already existing hooks.
Multiarch libdirs is taken care of automagically.
Raises minimum cmake version by a little.

* Handle CMAKE_INSTALL_xxx being absolute paths for .pc file generation

In some cases the CMAKE_INSTAL_{BIN,MAN,DOC,LIB,INCLUDE}DIR variables
may turn out to be absolute paths in which case prepending ${prefix} in
the pkg-config .pc files will result in incorrect values.

For .pc file generation, figure out if these variables are absolute and
omit the prefix in the configured file when so.

See: ab25e4b7ed
2022-08-07 16:42:01 +02:00
Fabrice Fontaine 4d0b49edad cmake/OpenJPEGConfig.cmake: replace ABSOLUTE by REALPATH
Fix #1174 by replacing ABSOLUTE by REALPATH which will resolve symlinks:
https://cmake.org/cmake/help/latest/command/get_filename_component.html

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2021-01-07 14:11:26 +01:00
Fabrice Fontaine 14f4c27e7c Revert "Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)"
This reverts commit 65586374d6 which
breaks cross-compilation of poppler under buildroot (because of
DESTDIR usage).
2021-01-07 14:09:50 +01:00
Matthew Sharp 65586374d6 Use INC_DIR for OPENJPEG_INCLUDE_DIRS (fixes uclouvain#1174)
This fixes the case where the cmake file is accessed via a symlink.
2020-12-10 10:22:25 +11:00
Libor Bukata 24fd3ce777 The change makes a relative path to header files
always correct regardless of the number of sub-
directories in OPENJPEG_INSTALL_PACKAGE_DIR variable.
2018-08-31 12:57:40 +02:00
Mathieu Malaterre d518970039 [trunk] Start FolderReorgProposal task
Update issue 177
2012-09-28 08:11:41 +00:00