From bd7a5887fff7884ec7a552891a53766c245064de Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 31 Aug 2022 11:05:59 +0900 Subject: [PATCH] ARROW-17565: [C++] Backward compatible ${PACKAGE}_shared CMake target isn't provided (#14003) This is a follow-up of ARROW-12175 / #13892 . We introduced `${PACKAGE}::` namespace to all exported CMake targets such as `Arrow::arrow_shared` and `Arrow::arrow_static`, but we also provided no-namespaced CMake targets such as `arrow_shared` and `arrow_static` as aliases of namespaced CMake targets. However, the logic to provide `arrow_shared` was buggy. Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- cpp/src/arrow/ArrowConfig.cmake.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in index 83a0f849c486d..0aa298b665844 100644 --- a/cpp/src/arrow/ArrowConfig.cmake.in +++ b/cpp/src/arrow/ArrowConfig.cmake.in @@ -108,7 +108,8 @@ macro(arrow_keep_backward_compatibility namespace target_base_name) string(TOUPPER ${target_base_name} target_base_name_upper) if(NOT CMAKE_VERSION VERSION_LESS 3.18) - if(TARGET ${namespace}::${target_base_name} AND NOT TARGET ${target_base_name}_shared) + if(TARGET ${namespace}::${target_base_name}_shared AND NOT TARGET + ${target_base_name}_shared) add_library(${target_base_name}_shared ALIAS ${namespace}::${target_base_name}_shared) endif()