From fc716802c081f67ad2052beaacd8d52ebf2734d2 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 2 Jul 2024 12:07:28 +0800 Subject: [PATCH] cmake/add_library: enable library install by default enable library install by default to support nuttx export for cmake nuttx$ cmake --install build --prefix $PWD/build/staging/ -- Install configuration: "" -- Installing: nuttx/build/staging/lib/libarch.a -- Installing: nuttx/build/staging/lib/libbinfmt.a -- Installing: nuttx/build/staging/lib/libdrivers.a -- Installing: nuttx/build/staging/lib/libfs.a ... Signed-off-by: chao an --- cmake/nuttx_add_library.cmake | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/cmake/nuttx_add_library.cmake b/cmake/nuttx_add_library.cmake index 8bd3d16fa6..ac37179067 100644 --- a/cmake/nuttx_add_library.cmake +++ b/cmake/nuttx_add_library.cmake @@ -51,6 +51,9 @@ function(nuttx_add_library_internal target) target_include_directories( ${target} PRIVATE $>) + + # Set install config for all library + install(TARGETS ${target}) endfunction() # Auxiliary libraries @@ -101,9 +104,6 @@ function(nuttx_add_system_library target) # add to list of libraries to link to final nuttx binary set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target}) - - # install to library dir - install(TARGETS ${target} DESTINATION lib) endfunction() # Kernel Libraries @@ -183,11 +183,6 @@ function(nuttx_add_library target) set_property(GLOBAL APPEND PROPERTY NUTTX_SYSTEM_LIBRARIES ${target}) - get_target_property(target_type ${target} TYPE) - if(${target_type} STREQUAL "STATIC_LIBRARY") - install(TARGETS ${target} ARCHIVE DESTINATION ${CMAKE_BINARY_DIR}/staging) - endif() - nuttx_add_library_internal(${target}) endfunction()