cmake: Fix assimp target install rule fully specifying component

This commit ensures generated install rules for the assimp target are
all consistently associated with components named after LIBASSIMP_COMPONENT
or LIBASSIMP-DEV_COMPONENT CMake variables.

It streamlines the packaging of specific components of assimp in client
projects leveraging the CPACK_INSTALL_CMAKE_PROJECTS variable.

Failing to do so leads to "/path/to/assimp-build/code/cmake_install.cmake"
file having install rules associated with a component called "Unspecified".

See https://cmake.org/cmake/help/v3.10/command/install.html#installing-targets
and https://cmake.org/cmake/help/v3.22/module/CPack.html#variable:CPACK_INSTALL_CMAKE_PROJECTS
pull/4391/head
Jean-Christophe Fillion-Robin 2022-02-17 05:47:34 -05:00
parent 510504a2c6
commit 33a48c6ca6
No known key found for this signature in database
GPG Key ID: C588BCAD0295020A
1 changed files with 4 additions and 5 deletions

View File

@ -1317,11 +1317,10 @@ ENDIF ()
INSTALL( TARGETS assimp INSTALL( TARGETS assimp
EXPORT "${TARGETS_EXPORT_NAME}" EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} LIBRARY DESTINATION ${ASSIMP_LIB_INSTALL_DIR} COMPONENT ${LIBASSIMP_COMPONENT}
ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} ARCHIVE DESTINATION ${ASSIMP_LIB_INSTALL_DIR} COMPONENT ${LIBASSIMP-DEV_COMPONENT}
RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} RUNTIME DESTINATION ${ASSIMP_BIN_INSTALL_DIR} COMPONENT ${LIBASSIMP_COMPONENT}
FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} FRAMEWORK DESTINATION ${ASSIMP_LIB_INSTALL_DIR} COMPONENT ${LIBASSIMP_COMPONENT}
COMPONENT ${LIBASSIMP_COMPONENT}
INCLUDES DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR} INCLUDES DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}
) )
INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev) INSTALL( FILES ${PUBLIC_HEADERS} DESTINATION ${ASSIMP_INCLUDE_INSTALL_DIR}/assimp COMPONENT assimp-dev)