add installation components
CMake can now install specific sub-components when installing. This gives parent projects and users greater control over which parts of the library to install.
This commit is contained in:
parent
cd0b3f9695
commit
3533ad9f64
@ -247,20 +247,20 @@ if (FMT_INSTALL)
|
||||
# Install version, config and target files.
|
||||
install(
|
||||
FILES ${project_config} ${version_config}
|
||||
DESTINATION ${FMT_CMAKE_DIR})
|
||||
DESTINATION ${FMT_CMAKE_DIR} COMPONENT FMT_Development)
|
||||
install(EXPORT ${targets_export_name} DESTINATION ${FMT_CMAKE_DIR}
|
||||
NAMESPACE fmt::)
|
||||
NAMESPACE fmt:: COMPONENT FMT_Development)
|
||||
|
||||
# Install the library and headers.
|
||||
install(TARGETS ${INSTALL_TARGETS} EXPORT ${targets_export_name}
|
||||
LIBRARY DESTINATION ${FMT_LIB_DIR}
|
||||
ARCHIVE DESTINATION ${FMT_LIB_DIR}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||
LIBRARY DESTINATION ${FMT_LIB_DIR} COMPONENT FMT_Runtime
|
||||
ARCHIVE DESTINATION ${FMT_LIB_DIR} COMPONENT FMT_Development
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT FMT_Runtime)
|
||||
|
||||
install(FILES $<TARGET_PDB_FILE:${INSTALL_TARGETS}>
|
||||
DESTINATION ${FMT_LIB_DIR} OPTIONAL)
|
||||
install(FILES ${FMT_HEADERS} DESTINATION ${FMT_INC_DIR})
|
||||
install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}")
|
||||
DESTINATION ${FMT_LIB_DIR} OPTIONAL COMPONENT FMT_Development)
|
||||
install(FILES ${FMT_HEADERS} DESTINATION ${FMT_INC_DIR} COMPONENT FMT_Development)
|
||||
install(FILES "${pkgconfig}" DESTINATION "${FMT_PKGCONFIG_DIR}" COMPONENT FMT_Development)
|
||||
endif ()
|
||||
|
||||
if (FMT_DOC)
|
||||
|
||||
@ -9,4 +9,4 @@ add_custom_target(doc
|
||||
SOURCES api.rst syntax.rst usage.rst build.py conf.py _templates/layout.html)
|
||||
|
||||
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/
|
||||
DESTINATION share/doc/fmt OPTIONAL)
|
||||
DESTINATION share/doc/fmt OPTIONAL COMPONENT FMT_Documentation)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user