You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2022/04/08 20:32:53 UTC

[arrow] branch master updated: ARROW-15905: [Python][C++] Fix CMake warning when building PyArrow

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 29f387344d ARROW-15905: [Python][C++] Fix CMake warning when building PyArrow
29f387344d is described below

commit 29f387344dc03d00ba2c99aaca20faa9d5d35683
Author: Raúl Cumplido <ra...@gmail.com>
AuthorDate: Sat Apr 9 05:32:42 2022 +0900

    ARROW-15905: [Python][C++] Fix CMake warning when building PyArrow
    
    Use `find_package` to add `FindPkgConfig.cmake` instead of `include(FindPkgConfig)` to avoid warning being raised.
    
    Before the change when building pyarrow I could see the following warning:
    ```shell
    CMake Warning (dev) at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:438 (message):
      The package name passed to `find_package_handle_standard_args` (PkgConfig)
      does not match the name of the calling package (Arrow).  This can lead to
      problems in calling code that expects `find_package` result variables
      (e.g., `_FOUND`) to follow a certain pattern.
    Call Stack (most recent call first):
      /usr/share/cmake/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args)
      cmake_modules/FindArrow.cmake:39 (include)
      cmake_modules/FindArrowPython.cmake:47 (find_package)
      CMakeLists.txt:231 (find_package)
    This warning is for project developers.  Use -Wno-dev to suppress it.
    ```
    With the change the Warning disappears.
    
    The rationale for the change comes from some investigation over the [find_package](https://cmake.org/cmake/help/latest/command/find_package.html?highlight=find_package) and [include](https://cmake.org/cmake/help/latest/command/include.html?highlight=include) documentation and this [stackoverflow thread](https://stackoverflow.com/a/29316084)
    
    Closes #12840 from raulcd/ARROW-15905
    
    Authored-by: Raúl Cumplido <ra...@gmail.com>
    Signed-off-by: Sutou Kouhei <ko...@clear-code.com>
---
 cpp/cmake_modules/FindArrow.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cpp/cmake_modules/FindArrow.cmake b/cpp/cmake_modules/FindArrow.cmake
index 68024cc276..9d2faaf581 100644
--- a/cpp/cmake_modules/FindArrow.cmake
+++ b/cpp/cmake_modules/FindArrow.cmake
@@ -36,7 +36,7 @@ if(DEFINED ARROW_FOUND)
   return()
 endif()
 
-include(FindPkgConfig)
+find_package(PkgConfig)
 include(FindPackageHandleStandardArgs)
 
 if(WIN32 AND NOT MINGW)