Maarten Pronk created ARROW-18256: ------------------------------------- Summary: [C++] External/shared libthrift requires IMPORTED_IMPLIB in FindThrift.cmake Key: ARROW-18256 URL: https://issues.apache.org/jira/browse/ARROW-18256 Project: Apache Arrow Issue Type: Bug Components: C++ Affects Versions: 10.0.0 Reporter: Maarten Pronk
As mentioned in ARROW-18255, over at [https://github.com/JuliaPackaging/Yggdrasil/pull/5425,] we cross-compile Arrow to make it easily available within the Julia ecosystem. When compiling with `DARROW_THRIFT_USE_SHARED=ON` and using an external libthrift, CMAKE warns with: {quote}[12:00:54] CMake Warning (dev) in CMakeLists.txt: [12:00:54] Policy CMP0111 is not set: An imported target missing its location property [12:00:54] fails during generation. Run "cmake --help-policy CMP0111" for policy [12:00:54] details. Use the cmake_policy command to set the policy and suppress this [12:00:54] warning. [12:00:54] [12:00:54] IMPORTED_IMPLIB not set for imported target "thrift::thrift" configuration [12:00:54] "RELEASE". [12:00:54] This warning is for project developers. Use -Wno-dev to suppress it. {quote} This will lead to linking errors later on. I've fixed the warning with the following patch for v10. {quote}{{diff --git a/cpp/cmake_modules/FindThrift.cmake b/cpp/cmake_modules/FindThrift.cmake}} {{index 2f20a5cb5..2d1e728aa 100644}} {{--- a/cpp/cmake_modules/FindThrift.cmake}} {{+++ b/cpp/cmake_modules/FindThrift.cmake}} {{@@ -146,6 +146,7 @@ if(Thrift_FOUND)}} {{ endif()}} {{ set_target_properties(thrift::thrift}} {{ PROPERTIES IMPORTED_LOCATION "${THRIFT_LIB}"}} {{+ IMPORTED_IMPLIB "${THRIFT_LIB}"}} {{ INTERFACE_INCLUDE_DIRECTORIES "${THRIFT_INCLUDE_DIR}")}} {{ if(WIN32 AND NOT MSVC_TOOLCHAIN)}} {{ # We don't need this for Visual C++ because Thrift uses}} {quote} -- This message was sent by Atlassian Jira (v8.20.10#820010)