kou commented on pull request #11889:
URL: https://github.com/apache/arrow/pull/11889#issuecomment-990304721
Ah, it seems that we also need to specify `arrow_bundled_dependencies` to
`install(TARGETS arrow_static)` something like the following:
```diff
diff --git a/cpp/cmake_modules/BuildUtils.cmake
b/cpp/cmake_modules/BuildUtils.cmake
index 38c35d7e7..b88768790 100644
--- a/cpp/cmake_modules/BuildUtils.cmake
+++ b/cpp/cmake_modules/BuildUtils.cmake
@@ -240,7 +240,9 @@ function(ADD_ARROW_LIB LIB_NAME)
DEPENDENCIES
SHARED_INSTALL_INTERFACE_LIBS
STATIC_INSTALL_INTERFACE_LIBS
- OUTPUT_PATH)
+ OUTPUT_PATH
+ SHARED_INSTALL_EXTRA_TARGETS
+ STATIC_INSTALL_EXTRA_TARGETS)
cmake_parse_arguments(ARG
"${options}"
"${one_value_args}"
@@ -396,7 +398,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"${_lib_install_name}")
endif()
- install(TARGETS ${LIB_NAME}_shared ${INSTALL_IS_OPTIONAL}
+ install(TARGETS ${LIB_NAME}_shared ${ARG_SHARED_INSTALL_EXTRA_TARGETS}
${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -451,7 +453,7 @@ function(ADD_ARROW_LIB LIB_NAME)
"$<BUILD_INTERFACE:${ARG_STATIC_LINK_LIBS}>")
endif()
- install(TARGETS ${LIB_NAME}_static ${INSTALL_IS_OPTIONAL}
+ install(TARGETS ${LIB_NAME}_static ${ARG_STATIC_INSTALL_EXTRA_TARGETS}
${INSTALL_IS_OPTIONAL}
EXPORT ${LIB_NAME}_targets
RUNTIME DESTINATION ${RUNTIME_INSTALL_DIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
@@ -464,7 +466,7 @@ function(ADD_ARROW_LIB LIB_NAME)
arrow_install_cmake_find_module("${ARG_CMAKE_PACKAGE_NAME}")
set(TARGETS_CMAKE "${ARG_CMAKE_PACKAGE_NAME}Targets.cmake")
- install(EXPORT ${LIB_NAME}_targets
+ install(EXPORT ${LIB_NAME}_targets ${ARG_CMAKE_
FILE "${TARGETS_CMAKE}"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
diff --git a/cpp/src/arrow/CMakeLists.txt b/cpp/src/arrow/CMakeLists.txt
index 5736c557b..07520d919 100644
--- a/cpp/src/arrow/CMakeLists.txt
+++ b/cpp/src/arrow/CMakeLists.txt
@@ -557,7 +557,9 @@ add_arrow_lib(arrow
SHARED_INSTALL_INTERFACE_LIBS
${ARROW_SHARED_INSTALL_INTERFACE_LIBS}
STATIC_INSTALL_INTERFACE_LIBS
- ${ARROW_STATIC_INSTALL_INTERFACE_LIBS})
+ ${ARROW_STATIC_INSTALL_INTERFACE_LIBS}
+ STATIC_EXTRA_TARGETS
+ arrow_bundled_dependencies)
add_dependencies(arrow ${ARROW_LIBRARIES})
```
Or we can add `install(TARGETS arrow_bundled_dependencies EXPORT
arrow_targets ...)` separately.
Do you want me to take this up?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]