Build: Add COMPONENT to all install() commands

This makes it possible for downstream packagers and other integrators of
libjpeg-turbo to include only specific directories from the
libjpeg-turbo installation (or to install specific directories under a
different prefix, etc.)  The names of the components correspond to the
directories into which they will be installed.

Refer to libvips/libvips#3931, #265, #338

Closes #756
This commit is contained in:
Kleis Auke Wolthuizen
2024-04-12 11:46:21 +02:00
committed by DRC
parent 6a522fcda4
commit 24e09baaf0
4 changed files with 44 additions and 35 deletions

View File

@@ -89,5 +89,10 @@ GNUInstallDirs_get_absolute_install_dir(CMAKE_INSTALL_FULL_JAVADIR
set(CMAKE_INSTALL_JAVADIR ${CMAKE_INSTALL_JAVADIR} PARENT_SCOPE)
set(CMAKE_INSTALL_FULL_JAVADIR ${CMAKE_INSTALL_FULL_JAVADIR} PARENT_SCOPE)
report_directory(JAVADIR)
install_jar(turbojpeg-java ${CMAKE_INSTALL_JAVADIR})
if(CMAKE_VERSION VERSION_EQUAL "3.4" OR CMAKE_VERSION VERSION_GREATER "3.4")
install_jar(turbojpeg-java DESTINATION ${CMAKE_INSTALL_JAVADIR}
COMPONENT java)
else()
install_jar(turbojpeg-java ${CMAKE_INSTALL_JAVADIR})
endif()
mark_as_advanced(CLEAR CMAKE_INSTALL_JAVADIR)