From 3533ad9f6435d6d99f38aeaf511186d5a08ceef0 Mon Sep 17 00:00:00 2001 From: Jordan Williams Date: Fri, 10 Jan 2020 13:14:39 -0600 Subject: [PATCH] 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. --- CMakeLists.txt | 16 ++++++++-------- doc/CMakeLists.txt | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0b4ec0a7..3704f3da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 $ - 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) diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index f3dae606..156f8c79 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -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)