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
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
Prev Previous commit
Next Next commit
Bugfix
  • Loading branch information
robomics committed May 26, 2024
commit 49beae9d609ad69f00f9e3e0e283f4392d15a0a8
29 changes: 20 additions & 9 deletions recipes/arrow/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,10 @@ 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}")
cmake_suffix = "shared" if self.options.shared else "static"

self.cpp_info.components["libarrow"].set_property("pkg_config_name", "arrow")
self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Arrow::arrow_{cmake_suffix}")
self.cpp_info.components["libarrow"].libs = [f"arrow{suffix}"]
if not self.options.shared:
self.cpp_info.components["libarrow"].defines = ["ARROW_STATIC"]
Expand All @@ -442,13 +441,15 @@ def package_info(self):

if self.options.parquet:
self.cpp_info.components["libparquet"].set_property("pkg_config_name", "parquet")
self.cpp_info.components["libparquet"].set_property("cmake_target_name", f"Parquet::parquet_{cmake_suffix}")
self.cpp_info.components["libparquet"].libs = [f"parquet{suffix}"]
self.cpp_info.components["libparquet"].requires = ["libarrow"]
if not self.options.shared:
self.cpp_info.components["libparquet"].defines = ["PARQUET_STATIC"]

if self.options.get_safe("substrait"):
self.cpp_info.components["libarrow_substrait"].set_property("pkg_config_name", "arrow_substrait")
self.cpp_info.components["libarrow_substrait"].set_property("cmake_target_name", f"Arrow::arrow_substrait_{cmake_suffix}")
self.cpp_info.components["libarrow_substrait"].libs = [f"arrow_substrait{suffix}"]
self.cpp_info.components["libarrow_substrait"].requires = ["libparquet", "dataset"]

Expand All @@ -457,25 +458,29 @@ def package_info(self):

if self.options.acero:
self.cpp_info.components["libacero"].libs = [f"arrow_acero{suffix}"]
self.cpp_info.components["libacero"].set_property("cmake_target_name", f"Acero::arrow_acero_{cmake_suffix}")
self.cpp_info.components["libacero"].names["cmake_find_package"] = "acero"
self.cpp_info.components["libacero"].names["cmake_find_package_multi"] = "acero"
self.cpp_info.components["libacero"].names["pkg_config"] = "acero"
self.cpp_info.components["libacero"].requires = ["libarrow"]

if self.options.gandiva:
self.cpp_info.components["libgandiva"].set_property("pkg_config_name", "gandiva")
self.cpp_info.components["libgandiva"].set_property("cmake_target_name", f"Gandiva::gandiva_{cmake_suffix}")
self.cpp_info.components["libgandiva"].libs = [f"gandiva{suffix}"]
self.cpp_info.components["libgandiva"].requires = ["libarrow"]
if not self.options.shared:
self.cpp_info.components["libgandiva"].defines = ["GANDIVA_STATIC"]

if self.options.with_flight_rpc:
self.cpp_info.components["libarrow_flight"].set_property("pkg_config_name", "flight_rpc")
self.cpp_info.components["libarrow_flight"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}")
self.cpp_info.components["libarrow_flight"].libs = [f"arrow_flight{suffix}"]
self.cpp_info.components["libarrow_flight"].requires = ["libarrow"]

if self.options.get_safe("with_flight_sql"):
self.cpp_info.components["libarrow_flight_sql"].set_property("pkg_config_name", "flight_sql")
self.cpp_info.components["libarrow_flight_sql"].set_property("cmake_target_name", f"ArrowFlightSql::arrow_flight_sql_{cmake_suffix}")
self.cpp_info.components["libarrow_flight_sql"].libs = [f"arrow_flight_sql{suffix}"]
self.cpp_info.components["libarrow_flight_sql"].requires = ["libarrow", "libarrow_flight"]

Expand Down Expand Up @@ -559,22 +564,28 @@ def package_info(self):
# TODO: to remove in conan v2
self.cpp_info.filenames["cmake_find_package"] = "Arrow"
self.cpp_info.filenames["cmake_find_package_multi"] = "Arrow"
self.cpp_info.components["libarrow"].names["cmake_find_package"] = "arrow"
self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = "arrow"
self.cpp_info.components["libarrow"].names["cmake_find_package"] = f"arrow_{cmake_suffix}"
self.cpp_info.components["libarrow"].names["cmake_find_package_multi"] = f"arrow_{cmake_suffix}"
self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Arrow::arrow_{cmake_suffix}")
if self.options.parquet:
self.cpp_info.components["libparquet"].names["cmake_find_package"] = "parquet"
self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = "parquet"
self.cpp_info.components["libparquet"].names["cmake_find_package"] = f"parquet_{cmake_suffix}"
self.cpp_info.components["libparquet"].names["cmake_find_package_multi"] = f"parquet_{cmake_suffix}"
self.cpp_info.components["libarrow"].set_property("cmake_target_name", f"Parquet::parquet_{cmake_suffix}")
if self.options.get_safe("substrait"):
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = "arrow_substrait"
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = "arrow_substrait"
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package"] = f"arrow_substrait_{cmake_suffix}"
self.cpp_info.components["libarrow_substrait"].names["cmake_find_package_multi"] = f"arrow_substrait_{cmake_suffix}"
self.cpp_info.components["libarrow_substrait"].set_property("cmake_target_name", f"Arrow::arrow_substrait_{cmake_suffix}")
if self.options.gandiva:
self.cpp_info.components["libgandiva"].names["cmake_find_package"] = "gandiva"
self.cpp_info.components["libgandiva"].names["cmake_find_package_multi"] = "gandiva"
self.cpp_info.components["libgandiva"].set_property("cmake_target_name", f"Gandiva::gandiva_{cmake_suffix}")
if self.options.with_flight_rpc:
self.cpp_info.components["libarrow_flight"].names["cmake_find_package"] = "flight_rpc"
self.cpp_info.components["libarrow_flight"].names["cmake_find_package_multi"] = "flight_rpc"
self.cpp_info.components["libarrow_flight"].set_property("cmake_target_name", f"ArrowFlight::arrow_flight_{cmake_suffix}")
if self.options.get_safe("with_flight_sql"):
self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package"] = "flight_sql"
self.cpp_info.components["libarrow_flight_sql"].names["cmake_find_package_multi"] = "flight_sql"
self.cpp_info.components["libarrow_flight_sql"].set_property("cmake_target_name", f"ArrowFlightSql::arrow_flight_sql_{cmake_suffix}")
if self.options.cli and (self.options.with_cuda or self.options.with_flight_rpc or self.options.parquet):
self.env_info.PATH.append(os.path.join(self.package_folder, "bin"))
Loading