From 795d5ddb69ff38ccdb9ffcbe5226af7b194d5ec7 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Wed, 27 Sep 2023 13:18:59 -0400 Subject: [PATCH] xo-cmake: + xo_install_library2() --- cmake/xo_cxx.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cmake/xo_cxx.cmake b/cmake/xo_cxx.cmake index d2f95936..6728db82 100644 --- a/cmake/xo_cxx.cmake +++ b/cmake/xo_cxx.cmake @@ -49,6 +49,22 @@ macro(xo_install_include_tree) install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include) endmacro() +# ---------------------------------------------------------------- +# use this for a subdir that builds a library +# and supports find_package() +# +macro(xo_install_library2 target) + install( + TARGETS ${target} + EXPORT ${target}Targets + LIBRARY DESTINATION lib COMPONENT Runtime + ARCHIVE DESTINATION lib COMPONENT Development + RUNTIME DESTINATION bin COMPONENT Runtime + PUBLIC_HEADER DESTINATION include COMPONENT Development + BUNDLE DESTINATION bin COMPONENT Runtime + ) +endmacro() + # ---------------------------------------------------------------- # # dependency on an xo library (including header-only libraries)