You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "kou (via GitHub)" <gi...@apache.org> on 2023/04/17 20:38:46 UTC

[GitHub] [arrow] kou commented on a diff in pull request #35196: GH-35179: [C++] Fix IMPORTED_LOCATION property for Arrow::bundled_dependencies

kou commented on code in PR #35196:
URL: https://github.com/apache/arrow/pull/35196#discussion_r1169244422


##########
cpp/src/arrow/ArrowConfig.cmake.in:
##########
@@ -101,7 +101,7 @@ if(TARGET Arrow::arrow_static AND NOT TARGET Arrow::arrow_bundled_dependencies)
   foreach(CONFIGURATION ${arrow_static_configurations})
     string(TOUPPER "${CONFIGURATION}" CONFIGURATION)
     get_target_property(arrow_static_location Arrow::arrow_static
-                        LOCATION_${CONFIGURATION})
+                        IMPORTED_LOCATION_${CONFIGURATION})

Review Comment:
   This is not a problem.
   We can use `LOCATION_<CONFIG>` to get `IMPORTED_LOCATION` value:
   
   https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION.html
   
   > To get the location of an imported target read one of the [LOCATION](https://cmake.org/cmake/help/latest/prop_tgt/LOCATION.html#prop_tgt:LOCATION) or LOCATION_<CONFIG> properties.
   
   `LOCATION_<CONFIG>`: https://cmake.org/cmake/help/latest/prop_tgt/LOCATION_CONFIG.html
   
   We should have set `IMPORTED_CONFIGURATIONS` to `Arrow::arrow_bundled_dependencies`:
   
   ```diff
   diff --git a/cpp/src/arrow/ArrowConfig.cmake.in b/cpp/src/arrow/ArrowConfig.cmake.in
   index 74e510114c..deb7bf94a8 100644
   --- a/cpp/src/arrow/ArrowConfig.cmake.in
   +++ b/cpp/src/arrow/ArrowConfig.cmake.in
   @@ -103,6 +103,9 @@ if(TARGET Arrow::arrow_static AND NOT TARGET Arrow::arrow_bundled_dependencies)
        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}"
   ```



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org