raulcd commented on code in PR #252:
URL: https://github.com/apache/arrow-cookbook/pull/252#discussion_r963774283
##########
cpp/code/CMakeLists.txt:
##########
@@ -42,9 +49,14 @@ function(RECIPE TARGET)
common.cc
main.cc
)
+ if(TARGET Arrow::arrow_shared)
+ set(ARROW_SHARED_NAME Arrow::arrow_shared)
+ else()
+ set(ARROW_SHARED_NAME arrow_shared)
+ endif()
target_link_libraries(
${TARGET}
- arrow_shared
+ ${ARROW_SHARED_NAME}
arrow_dataset
arrow_flight
parquet
Review Comment:
I had to use the `INTERFACE` keyword here:
```
target_link_libraries(parquet_shared INTERFACE arrow_shared)
target_link_libraries(arrow_dataset_shared INTERFACE parquet_shared)
target_link_libraries(arrow_flight_shared INTERFACE arrow_shared)
```
otherwise I got a bunch of errors:
```
CMake Error at CMakeLists.txt:60 (target_link_libraries):
IMPORTED library can only be used with the INTERFACE keyword of
target_link_libraries
Call Stack (most recent call first):
CMakeLists.txt:75 (recipe)
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]