Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrow: fix target names #24106

Merged
merged 7 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use the same CMake target names as upstream
  • Loading branch information
robomics committed May 26, 2024
commit 092d950383adf2a0e83b2970112b9ce349ac239d
3 changes: 3 additions & 0 deletions recipes/arrow/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ def package_info(self):
self.cpp_info.set_property("cmake_file_name", "Arrow")

suffix = "_static" if is_msvc(self) and not self.options.shared else ""
cmake_tgt_suffix = "arrow_shared" if self.options.shared else "arrow_static"

self.cpp_info.set_property("cmake_target_name", f"Arrow::{cmake_tgt_suffix}")

self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow")
self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"]
Expand Down
8 changes: 7 additions & 1 deletion recipes/arrow/all/test_package/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ project(test_package LANGUAGES CXX)
find_package(Arrow REQUIRED CONFIG)

add_executable(${PROJECT_NAME} test_package.cpp)
target_link_libraries(${PROJECT_NAME} PRIVATE arrow::arrow)

if (TARGET Arrow::arrow_shared)
target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_shared)
else()
target_link_libraries(${PROJECT_NAME} PRIVATE Arrow::arrow_static)
endif()

if (${Arrow_VERSION} VERSION_LESS "10.0.0")
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_11)
else()
Expand Down
Loading