Commits


Kousuke Saruta authored and Wes McKinney committed 8ab1493c810
ARROW-4065: [C++] arrowTargets.cmake is broken When we build Arrow's cpp library using CMake, arrowTargets.cmake will be generated and installed but it's broken. The following is a part of arrowTargets.cmake generated. ``` # Create imported target arrow_shared add_library(arrow_shared SHARED IMPORTED) set_target_properties(arrow_shared PROPERTIES INTERFACE_LINK_LIBRARIES "dl;pthreadshared" ) # Create imported target arrow_static add_library(arrow_static STATIC IMPORTED) set_target_properties(arrow_static PROPERTIES INTERFACE_LINK_LIBRARIES "glog_static;zstd_static;zlib_shared;snappy_static;lz4_static;brotli_dec_static;brotli_enc_static;brotli_common_static;double-conversion_static;boost_system_shared;boost_filesystem_shared;boost_regex_shared;jemalloc_static;rt;pthreadshared" ) ``` There are no INTERFACE_INCLUDE_DIRECTORIES and linker doesn't recognize pthreadshared because the true name of pthread should be libpthread.so or libpthread.a. *_static and *_shared are also wrong name. After this fix, we can build apps which links to arrow using CMake with CMakeLists.txt like as follows. ``` cmake_minimum_required(VERSION ...) project(...) ... find_package(arrow) add_executable(your_excellent_app ...) target_link_libraries(your_excellent_app arrow_shared) # or arrow_static ... ``` `$ cmake -D CMAKE_PREFIX_PATH=/path/to/arrow /path/to/CMakeLists.txt` `$ cmake --build .` Author: Kousuke Saruta <sarutak@oss.nttdata.com> Closes #3212 from sarutak/improve-cmake-config-file-generation and squashes the following commits: 0213d2666 <Kousuke Saruta> Fix cpp/CMakeLists.txt, src/arrow/CMakeLists.txt and BuildUtils.cmake to enable building apps which links to Arrow using arrowTargets.cmake