2023-01-15 03:37:42 +08:00
|
|
|
if(NOT FTXUI_ENABLE_INSTALL)
|
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2021-06-26 21:14:27 +08:00
|
|
|
include(GNUInstallDirs)
|
2023-05-19 23:50:23 +08:00
|
|
|
include(CMakePackageConfigHelpers)
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2023-05-19 23:50:23 +08:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Install the library and its public headers into the standard subdirectories
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
install(
|
|
|
|
TARGETS screen dom component
|
|
|
|
EXPORT ftxui-targets
|
|
|
|
)
|
2021-06-26 21:14:27 +08:00
|
|
|
|
2023-05-19 23:50:23 +08:00
|
|
|
install(
|
|
|
|
DIRECTORY include/ftxui
|
|
|
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Install the exported cmake targets for use in other CMake projects.
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
install(
|
|
|
|
EXPORT ftxui-targets
|
|
|
|
NAMESPACE ftxui::
|
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
|
|
|
)
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Create and install the ftuxi-config.cmake and ftuxi-config-version.cmake files
|
|
|
|
# needed to support users of find_package()
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
configure_package_config_file(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/ftxui-config.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake/ftxui-config.cmake
|
2021-06-26 21:14:27 +08:00
|
|
|
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/ftxui/cmake
|
|
|
|
PATH_VARS CMAKE_INSTALL_INCLUDEDIR
|
2023-05-19 23:50:23 +08:00
|
|
|
)
|
2021-06-26 21:14:27 +08:00
|
|
|
write_basic_package_version_file(
|
2023-05-19 23:50:23 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake/ftxui-config-version.cmake
|
2021-06-26 21:14:27 +08:00
|
|
|
VERSION ${PACKAGE_VERSION}
|
2023-05-19 23:50:23 +08:00
|
|
|
COMPATIBILITY SameMajorVersion
|
|
|
|
)
|
|
|
|
install(
|
|
|
|
FILES
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake/ftxui-config.cmake
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake/ftxui-config-version.cmake
|
2021-06-26 21:14:27 +08:00
|
|
|
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ftxui
|
2023-05-19 23:50:23 +08:00
|
|
|
)
|
2023-05-17 16:50:47 +08:00
|
|
|
|
2023-05-19 23:50:23 +08:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
# Create and install pkg-config file for easy use of library in build systems
|
|
|
|
# other than CMake:
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
configure_file(ftxui.pc.in ${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc @ONLY)
|
|
|
|
install(
|
|
|
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/ftxui.pc
|
2023-05-29 21:20:24 +08:00
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
|
2023-05-19 23:50:23 +08:00
|
|
|
)
|