Skip to content

Commit

Permalink
ARROW-17565: [C++] Backward compatible ${PACKAGE}_shared CMake target…
Browse files Browse the repository at this point in the history
… isn't provided (apache#14003)

This is a follow-up of ARROW-12175 / apache#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 <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
kou authored and zagto committed Oct 7, 2022
1 parent 3b783c8 commit bd7a588
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cpp/src/arrow/ArrowConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit bd7a588

Please sign in to comment.