Repository navigation
Description
Describe the enhancement requested
arrow_create_merged_static_lib() creates arrow_bundled_dependencies as an IMPORTED library. We can't use install(TARGETS) for it. So we install only the archive by install(FILES) and create Arrow::arrow_bundled_dependencies manually in ArrowConfig.cmake.
So ArrowConfig.cmake needs to do things that CMake usually does for us:
arrow/cpp/src/arrow/ArrowConfig.cmake.in
Lines 113 to 157 in dd619ad
| if(TARGET Arrow::arrow_static AND NOT TARGET Arrow::arrow_bundled_dependencies) | |
| add_library(Arrow::arrow_bundled_dependencies STATIC IMPORTED) | |
| get_target_property(arrow_static_configurations Arrow::arrow_static | |
| IMPORTED_CONFIGURATIONS) | |
| foreach(CONFIGURATION ${arrow_static_configurations}) | |
| string(TOUPPER "${CONFIGURATION}" CONFIGURATION) | |
| get_target_property(arrow_static_location Arrow::arrow_static | |
| LOCATION_${CONFIGURATION}) | |
| get_filename_component(arrow_lib_dir "${arrow_static_location}" DIRECTORY) | |
| set_property(TARGET Arrow::arrow_bundled_dependencies | |
| APPEND | |
| PROPERTY IMPORTED_CONFIGURATIONS ${CONFIGURATION}) | |
| set_target_properties(Arrow::arrow_bundled_dependencies | |
| PROPERTIES IMPORTED_LOCATION_${CONFIGURATION} | |
| "${arrow_lib_dir}/${CMAKE_STATIC_LIBRARY_PREFIX}arrow_bundled_dependencies${CMAKE_STATIC_LIBRARY_SUFFIX}" | |
| ) | |
| endforeach() | |
| # CMP0057: Support new if() IN_LIST operator. | |
| # https://cmake.org/cmake/help/latest/policy/CMP0057.html | |
| cmake_policy(PUSH) | |
| cmake_policy(SET CMP0057 NEW) | |
| if("aws-c-common" IN_LIST ARROW_BUNDLED_STATIC_LIBS) | |
| if(APPLE) | |
| find_library(CORE_FOUNDATION CoreFoundation) | |
| target_link_libraries(Arrow::arrow_bundled_dependencies | |
| INTERFACE ${CORE_FOUNDATION}) | |
| find_library(NETWORK Network) | |
| target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${NETWORK}) | |
| find_library(SECURITY Security) | |
| target_link_libraries(Arrow::arrow_bundled_dependencies INTERFACE ${SECURITY}) | |
| elseif(WIN32) | |
| target_link_libraries(Arrow::arrow_bundled_dependencies | |
| INTERFACE "winhttp.lib" | |
| "bcrypt.lib" | |
| "wininet.lib" | |
| "userenv.lib" | |
| "version.lib" | |
| "ncrypt.lib" | |
| "Secur32.lib" | |
| "Shlwapi.lib") | |
| endif() | |
| endif() | |
| cmake_policy(POP) | |
| endif() |
We know everything about the bundled dependencies at build time. We should define arrow_bundled_dependencies as a normal (not IMPORTED) static library target with its dependencies and export it by install(TARGETS ... EXPORT ...). Then we can remove the code that creates Arrow::arrow_bundled_dependencies from ArrowConfig.cmake. Each bundled dependency can declare the libraries it needs where we build it in ThirdpartyToolchain.cmake. We can do the same for arrow_gcs_bundled_dependencies.
Component(s)
C++
Activity
AnuragRaut08 commentedon Nov 14, 2026
I'd like to take this up. I'll look into replacing the manually created imported targets with properly exported static library targets and simplify the corresponding
ArrowConfig.cmakelogic, including the GCS bundled dependencies.