kou commented on code in PR #14097:
URL: https://github.com/apache/arrow/pull/14097#discussion_r968928276


##########
docs/source/cpp/build_system.rst:
##########
@@ -67,11 +67,55 @@ CMake variables:
 In addition, it will have created some targets that you can link against
 (note these are plain strings, not variables):
 
-* ``arrow_shared`` links to the Arrow shared libraries
-* ``arrow_static`` links to the Arrow static libraries
+* ``Arrow::arrow_shared`` links to the Arrow shared libraries
+* ``Arrow::arrow_static`` links to the Arrow static libraries
+
+For backwards compatibility purposes the ``arrow_shared`` and ``arrow_static``
+targets are also available but we recomend using ``Arrow::arrow_shared`` and
+``Arrow::arrow_static`` respectively.
 
 In most cases, it is recommended to use the Arrow shared libraries.
 
+If Arrow is installed on a custom path instead of a common system one you
+will have to add the path where Arrow is installed to ``CMAKE_PREFIX_PATH``.
+
+.. note::
+   The usage of ``COMPONENTS`` on our ``find_package`` implementation is
+   currently not supported.
+
+Other available packages
+------------------------
+
+There are other available packages, they can also be used with the 
`find_package
+<https://cmake.org/cmake/help/latest/command/find_package.html>`_ directive.
+This is the list of available ones and the respective targets created:
+
++-----------------------------------------------+----------------------------------------------------+-------------------------------------------------+
+| find_package usage                            | shared target                
                      | static target                                   |
++===============================================+====================================================+=================================================+
+| ``find_package(ArrowCUDA REQUIRED)``          | ArrowCUDA::arrow_cuda_shared 
                      | ArrowCUDA::arrow_cuda_static                    |
++-----------------------------------------------+----------------------------------------------------+-------------------------------------------------+
+| ``find_package(ArrowDataset REQUIRED)``       | 
ArrowDataset::arrow_dataset_shared                 | 
ArrowDataset::arrow_dataset_static              |
++-----------------------------------------------+----------------------------------------------------+-------------------------------------------------+
+| ``find_package(ArrowFlight REQUIRED)``        | 
ArrowFlight::arrow_flight_shared                   | 
ArrowFlight::arrow_flight_static                |
++-----------------------------------------------+----------------------------------------------------+-------------------------------------------------+
+| ``find_package(ArrowFlightSql REQUIRED)`      | 
ArrowFlightSql::arrow_flight_sql_shared            | 
ArrowFlightSql::arrow_flight_sql_static         |

Review Comment:
   ```suggestion
   | ``find_package(ArrowFlightSql REQUIRED)``     | 
ArrowFlightSql::arrow_flight_sql_shared            | 
ArrowFlightSql::arrow_flight_sql_static         |
   ```



##########
docs/source/cpp/build_system.rst:
##########
@@ -67,11 +67,55 @@ CMake variables:
 In addition, it will have created some targets that you can link against
 (note these are plain strings, not variables):
 
-* ``arrow_shared`` links to the Arrow shared libraries
-* ``arrow_static`` links to the Arrow static libraries
+* ``Arrow::arrow_shared`` links to the Arrow shared libraries
+* ``Arrow::arrow_static`` links to the Arrow static libraries
+
+For backwards compatibility purposes the ``arrow_shared`` and ``arrow_static``
+targets are also available but we recomend using ``Arrow::arrow_shared`` and
+``Arrow::arrow_static`` respectively.
 
 In most cases, it is recommended to use the Arrow shared libraries.
 
+If Arrow is installed on a custom path instead of a common system one you
+will have to add the path where Arrow is installed to ``CMAKE_PREFIX_PATH``.

Review Comment:
   Could you add examples how to add the path to `CMAKE_PREFIX_PATH`?
   
   There are 2 ways to add:
   
   1. `cmake ... -DCMAKE_PREFIX_PATH=...`: CMake variable: 
https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
   2. `export CMAKE_PREFIX_PATH=...`: Environment variable: 
https://cmake.org/cmake/help/latest/envvar/CMAKE_PREFIX_PATH.html
   
   I think the latter is better for most cases because the `CMAKE_PREFIX_PATH` 
environment variable may be defined in other place.
   
   If we specify `cmake -DCMAKE_PREFIX_PATH=${ARROW_ROOT}`, the pre-defined 
`CMAKE_PREFIX_PATH` environment variable value is ignored. (I didn't confirm it 
yet but I think so. Sorry.) We can use the pre-defined `CMAKE_PREFIX_PATH` 
environment variable value by `cmake 
-DCMAKE_PREFIX_PATH=${ARROW_ROOT}${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}`. 
(`${X:+...}` is a variable substitution syntax. See also `${parameter:+word}` 
in 
https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
 . This is used here to not include an empty path such as `cmake 
-DCMAKE_PREFIX_PATH=${ARROW_ROOT}:`.)
   
   We can use the variable substitution syntax with `export 
CMAKE_PREFIX_PATH=...` case:
   
   ```bash
   export 
CMAKE_PREFIX_PATH=${ARROW_ROOT}${CMAKE_PREFIX_PATH:+:${CMAKE_PREFIX_PATH}}
   ```
   



-- 
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]

Reply via email to