summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Bracht Laumann Jespersen <t@laumann.xyz>2022-08-07 16:42:01 +0200
committerGitHub <noreply@github.com>2022-08-07 16:42:01 +0200
commitc7bccf0515892617af984328e96cff5b4a6cd6d3 (patch)
tree67fe67826f15c36e97cc6b8edf150e0b4e68fee5 /src
parente3f07dcc07c651321ec3b5f540ef698bbe6f1906 (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/jp2/CMakeLists.txt4
-rw-r--r--src/bin/jpip/CMakeLists.txt10
-rw-r--r--src/lib/openjp2/CMakeLists.txt12
-rw-r--r--src/lib/openjp2/libopenjp2.pc.cmake.in10
-rw-r--r--src/lib/openjpip/CMakeLists.txt8
-rw-r--r--src/lib/openjpip/libopenjpip.pc.cmake.in10
6 files changed, 27 insertions, 27 deletions
diff --git a/src/bin/jp2/CMakeLists.txt b/src/bin/jp2/CMakeLists.txt
index 4d4bd952..29b4dd20 100644
--- a/src/bin/jp2/CMakeLists.txt
+++ b/src/bin/jp2/CMakeLists.txt
@@ -67,7 +67,7 @@ foreach(exe opj_decompress opj_compress opj_dump)
# Install exe
install(TARGETS ${exe}
EXPORT OpenJPEGTargets
- DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
)
if(OPJ_USE_DSYMUTIL)
add_custom_command(TARGET ${exe} POST_BUILD
@@ -83,6 +83,6 @@ install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_compress.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_decompress.1
${OPENJPEG_SOURCE_DIR}/doc/man/man1/opj_dump.1
- DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man1)
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
#
endif()
diff --git a/src/bin/jpip/CMakeLists.txt b/src/bin/jpip/CMakeLists.txt
index c16e4271..a501cfa5 100644
--- a/src/bin/jpip/CMakeLists.txt
+++ b/src/bin/jpip/CMakeLists.txt
@@ -13,7 +13,7 @@ add_executable(opj_jpip_addxml opj_jpip_addxml.c)
# Install exe
install(TARGETS opj_jpip_addxml
EXPORT OpenJPEGTargets
- DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
)
if(BUILD_JPIP_SERVER)
@@ -38,7 +38,7 @@ if(BUILD_JPIP_SERVER)
# Install exe
install(TARGETS opj_server
EXPORT OpenJPEGTargets
- DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
)
endif()
@@ -52,7 +52,7 @@ add_executable(${exe} ${exe}.c)
target_link_libraries(${exe} openjpip)
install(TARGETS ${exe}
EXPORT OpenJPEGTargets
- DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
+ DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
)
endforeach()
@@ -123,7 +123,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
)
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
- DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} COMPONENT JavaModule
)
else()
# opj_viewer (simple, no xerces)
@@ -153,7 +153,7 @@ if(Java_Development_FOUND AND Java_JAVAC_EXECUTABLE)
)
install(FILES ${LIBRARY_OUTPUT_PATH}/opj_jpip_viewer.jar
- DESTINATION ${OPENJPEG_INSTALL_SHARE_DIR} COMPONENT JavaModule
+ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR} COMPONENT JavaModule
)
endif()
else()
diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt
index ea4131a3..e65cb9d1 100644
--- a/src/lib/openjp2/CMakeLists.txt
+++ b/src/lib/openjp2/CMakeLists.txt
@@ -2,7 +2,7 @@ include_regular_expression("^.*$")
#
install( FILES ${CMAKE_CURRENT_BINARY_DIR}/opj_config.h
- DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers)
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers)
include_directories(
${${OPENJPEG_NAMESPACE}_BINARY_DIR}/src/lib/openjp2 # opj_config.h and opj_config_private.h
@@ -117,21 +117,21 @@ endif()
# Install library
install(TARGETS ${INSTALL_LIBS}
EXPORT OpenJPEGTargets
- RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
- LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
- ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
)
# Install includes files
install(FILES openjpeg.h opj_stdint.h
- DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR} COMPONENT Headers
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENJPEG_INSTALL_SUBDIR} COMPONENT Headers
)
if(BUILD_DOC)
# install man page of the library
install(
FILES ${OPENJPEG_SOURCE_DIR}/doc/man/man3/libopenjp2.3
- DESTINATION ${OPENJPEG_INSTALL_MAN_DIR}/man3)
+ DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
endif()
if(BUILD_LUTS_GENERATOR)
diff --git a/src/lib/openjp2/libopenjp2.pc.cmake.in b/src/lib/openjp2/libopenjp2.pc.cmake.in
index 00fdacd1..2ade312b 100644
--- a/src/lib/openjp2/libopenjp2.pc.cmake.in
+++ b/src/lib/openjp2/libopenjp2.pc.cmake.in
@@ -1,9 +1,9 @@
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@
+bindir=@bindir@
+mandir=@mandir@
+docdir=@docdir@
+libdir=@libdir@
+includedir=@includedir@
Name: openjp2
Description: JPEG2000 library (Part 1 and 2)
diff --git a/src/lib/openjpip/CMakeLists.txt b/src/lib/openjpip/CMakeLists.txt
index b3cb8ce8..aace36d4 100644
--- a/src/lib/openjpip/CMakeLists.txt
+++ b/src/lib/openjpip/CMakeLists.txt
@@ -74,9 +74,9 @@ endif()
# Install library
install(TARGETS openjpip
EXPORT OpenJPEGTargets
- RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
- LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
- ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT Applications
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
)
if(BUILD_JPIP_SERVER)
@@ -86,6 +86,6 @@ if(BUILD_JPIP_SERVER)
PROPERTIES COMPILE_FLAGS "-DSERVER")
install(TARGETS openjpip_server
EXPORT OpenJPEGTargets
- DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
+ DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT Libraries
)
endif()
diff --git a/src/lib/openjpip/libopenjpip.pc.cmake.in b/src/lib/openjpip/libopenjpip.pc.cmake.in
index 183b68ff..fc97ef04 100644
--- a/src/lib/openjpip/libopenjpip.pc.cmake.in
+++ b/src/lib/openjpip/libopenjpip.pc.cmake.in
@@ -1,9 +1,9 @@
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@
+bindir=@bindir@
+mandir=@mandir@
+docdir=@docdir@
+libdir=@libdir@
+includedir=@includedir@
Name: openjpip
Description: JPEG2000 Interactivity tools, APIs and protocols (Part 9)