CMake: switch to GNUInstallDirs (#1424)
authorThomas Bracht Laumann Jespersen <t@laumann.xyz>
Sun, 7 Aug 2022 14:42:01 +0000 (16:42 +0200)
committerGitHub <noreply@github.com>
Sun, 7 Aug 2022 14:42:01 +0000 (16:42 +0200)
commitc7bccf0515892617af984328e96cff5b4a6cd6d3
tree67fe67826f15c36e97cc6b8edf150e0b4e68fee5
parente3f07dcc07c651321ec3b5f540ef698bbe6f1906
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: https://github.com/OSGeo/PROJ/commit/ab25e4b7ed9544e668282dcd293cfaaa2e56dbdf
CMakeLists.txt
cmake/OpenJPEGConfig.cmake.in
doc/CMakeLists.txt
src/bin/jp2/CMakeLists.txt
src/bin/jpip/CMakeLists.txt
src/lib/openjp2/CMakeLists.txt
src/lib/openjp2/libopenjp2.pc.cmake.in
src/lib/openjpip/CMakeLists.txt
src/lib/openjpip/libopenjpip.pc.cmake.in
wrapping/java/openjp2/CMakeLists.txt