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-16993: [C++] cmake: cannot create imported target "Boost::headers" #13845

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
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
7 changes: 4 additions & 3 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1019,12 +1019,13 @@ if(ARROW_USE_BOOST)
# Find static boost headers and libs
set(Boost_USE_STATIC_LIBS ON)
endif()
if(ARROW_BOOST_REQUIRE_LIBRARY)
set(ARROW_BOOST_COMPONENTS COMPONENTS system filesystem)
endif()
resolve_dependency(Boost
REQUIRED_VERSION
${ARROW_BOOST_REQUIRED_VERSION}
COMPONENTS
system
filesystem
${ARROW_BOOST_COMPONENTS}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can specify empty COMPONENTS like #13846.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the advantage of your approach? The COMPONENTS arg completely missing or being empty has the same effect as if(ARG_COMPONENTS) will be false.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also sorry for just opening a PR for a ticket you are assigned to. This issue was preventing us from submitting the R package to CRAN so we needed a fix fast and wanted to merge it back now)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Both approaches have the same effect.
I think that the empty COMPONENTS approach is easiar to read. Putting the COMPONENTS keyword by a variable expansion may be a bit tricky.

If you like your approach, could you use ARROW_BOOST_COMPONENTS_ARGS or something instead of ARROW_BOOST_COMPONENTS for the variable name? Because the COMPONENTS keyword isn't a component.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like @kou I would find COMPONENTS ${ARROW_BOOST_COMPONENTS} to be slightly more explicit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok than let's go with @kou s version in #13846

IS_RUNTIME_DEPENDENCY
# libarrow.so doesn't depend on libboost*.
FALSE)
Expand Down