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 a242eb1736 ARROW-16585: [C++] Add support for absolute 
CMAKE_INSTALL_*DIR
a242eb1736 is described below

commit a242eb17362c0352fc3291213542c48abfe18669
Author: Sutou Kouhei <[email protected]>
AuthorDate: Thu May 19 10:56:18 2022 +0900

    ARROW-16585: [C++] Add support for absolute CMAKE_INSTALL_*DIR
    
    Closes #13182 from kou/cpp-pkg-config-path
    
    Authored-by: Sutou Kouhei <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 cpp/CMakeLists.txt                                       | 15 +++++++++++++++
 cpp/src/arrow/adapters/orc/arrow-orc.pc.in               |  5 +++--
 cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in |  5 +++--
 cpp/src/arrow/arrow-testing.pc.in                        |  6 ++++--
 cpp/src/arrow/arrow.pc.in                                |  5 +++--
 cpp/src/arrow/compute/arrow-compute.pc.in                |  4 ++++
 cpp/src/arrow/csv/arrow-csv.pc.in                        |  5 +++--
 cpp/src/arrow/dataset/arrow-dataset.pc.in                |  5 +++--
 cpp/src/arrow/engine/arrow-substrait.pc.in               |  5 +++--
 cpp/src/arrow/filesystem/arrow-filesystem.pc.in          |  5 +++--
 cpp/src/arrow/flight/arrow-flight-testing.pc.in          |  5 +++--
 cpp/src/arrow/flight/arrow-flight.pc.in                  |  5 +++--
 cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in          |  5 +++--
 cpp/src/arrow/gpu/arrow-cuda.pc.in                       |  5 +++--
 cpp/src/arrow/json/arrow-json.pc.in                      |  5 +++--
 cpp/src/arrow/python/arrow-python-flight.pc.in           |  5 +++--
 cpp/src/arrow/python/arrow-python.pc.in                  |  5 +++--
 cpp/src/gandiva/gandiva.pc.in                            |  4 ++--
 cpp/src/parquet/parquet.pc.in                            |  4 ++--
 cpp/src/plasma/PlasmaConfig.cmake.in                     |  2 +-
 cpp/src/plasma/plasma.pc.in                              |  7 ++++---
 cpp/src/skyhook/skyhook.pc.in                            |  6 +++---
 22 files changed, 77 insertions(+), 41 deletions(-)

diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 23e0ba311f..0ae86cba4b 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -104,6 +104,21 @@ include(ExternalProject)
 include(FindPackageHandleStandardArgs)
 
 include(GNUInstallDirs)
+if(IS_ABSOLUTE "${CMAKE_INSTALL_BINDIR}")
+  set(ARROW_PKG_CONFIG_BINDIR "${CMAKE_INSTALL_BINDIR}")
+else()
+  set(ARROW_PKG_CONFIG_BINDIR "\${prefix}/${CMAKE_INSTALL_BINDIR}")
+endif()
+if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
+  set(ARROW_PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
+else()
+  set(ARROW_PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
+endif()
+if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
+  set(ARROW_PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
+else()
+  set(ARROW_PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
+endif()
 
 set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
 
diff --git a/cpp/src/arrow/adapters/orc/arrow-orc.pc.in 
b/cpp/src/arrow/adapters/orc/arrow-orc.pc.in
index eec59ccc52..87e214f3e4 100644
--- a/cpp/src/arrow/adapters/orc/arrow-orc.pc.in
+++ b/cpp/src/arrow/adapters/orc/arrow-orc.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow ORC
 Description: ORC modules for Apache Arrow
diff --git a/cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in 
b/cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in
index a2b38a0a01..2787f436e7 100644
--- a/cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in
+++ b/cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Tensorflow
 Description: TensorFlow modules for Apache Arrow
diff --git a/cpp/src/arrow/arrow-testing.pc.in 
b/cpp/src/arrow/arrow-testing.pc.in
index 39c08fcf04..5a991e796d 100644
--- a/cpp/src/arrow/arrow-testing.pc.in
+++ b/cpp/src/arrow/arrow-testing.pc.in
@@ -15,8 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
+
 gtest_includedir=@GTEST_INCLUDE_DIR@
 
 Name: Apache Arrow testing
diff --git a/cpp/src/arrow/arrow.pc.in b/cpp/src/arrow/arrow.pc.in
index ef995fdc3d..3a5710ab6b 100644
--- a/cpp/src/arrow/arrow.pc.in
+++ b/cpp/src/arrow/arrow.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 so_version=@ARROW_SO_VERSION@
 abi_version=@ARROW_SO_VERSION@
diff --git a/cpp/src/arrow/compute/arrow-compute.pc.in 
b/cpp/src/arrow/compute/arrow-compute.pc.in
index bbdb12c470..35bfb51683 100644
--- a/cpp/src/arrow/compute/arrow-compute.pc.in
+++ b/cpp/src/arrow/compute/arrow-compute.pc.in
@@ -15,6 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
+
 Name: Apache Arrow Compute
 Description: Compute modules for Apache Arrow
 Version: @ARROW_VERSION@
diff --git a/cpp/src/arrow/csv/arrow-csv.pc.in 
b/cpp/src/arrow/csv/arrow-csv.pc.in
index 9c69c6923a..99571966f0 100644
--- a/cpp/src/arrow/csv/arrow-csv.pc.in
+++ b/cpp/src/arrow/csv/arrow-csv.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow CSV
 Description: CSV reader module for Apache Arrow
diff --git a/cpp/src/arrow/dataset/arrow-dataset.pc.in 
b/cpp/src/arrow/dataset/arrow-dataset.pc.in
index c03aad3787..7c433321c1 100644
--- a/cpp/src/arrow/dataset/arrow-dataset.pc.in
+++ b/cpp/src/arrow/dataset/arrow-dataset.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Dataset
 Description: Apache Arrow Dataset provides an API to read and write semantic 
datasets stored in different locations and formats.
diff --git a/cpp/src/arrow/engine/arrow-substrait.pc.in 
b/cpp/src/arrow/engine/arrow-substrait.pc.in
index 82aadbc3b5..77ac510933 100644
--- a/cpp/src/arrow/engine/arrow-substrait.pc.in
+++ b/cpp/src/arrow/engine/arrow-substrait.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Substrait Consumer
 Description: Apache Arrow's Substrait Consumer.
diff --git a/cpp/src/arrow/filesystem/arrow-filesystem.pc.in 
b/cpp/src/arrow/filesystem/arrow-filesystem.pc.in
index 4fcc6244f9..8a2c05f785 100644
--- a/cpp/src/arrow/filesystem/arrow-filesystem.pc.in
+++ b/cpp/src/arrow/filesystem/arrow-filesystem.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Filesystem
 Description: Filesystem API for accessing local and remote filesystems
diff --git a/cpp/src/arrow/flight/arrow-flight-testing.pc.in 
b/cpp/src/arrow/flight/arrow-flight-testing.pc.in
index 6946b84f74..0b7224a9ce 100644
--- a/cpp/src/arrow/flight/arrow-flight-testing.pc.in
+++ b/cpp/src/arrow/flight/arrow-flight-testing.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Flight testing
 Description: Library for testing Apache Arrow Flight related programs.
diff --git a/cpp/src/arrow/flight/arrow-flight.pc.in 
b/cpp/src/arrow/flight/arrow-flight.pc.in
index 3d66f9937e..955fc19b0d 100644
--- a/cpp/src/arrow/flight/arrow-flight.pc.in
+++ b/cpp/src/arrow/flight/arrow-flight.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Flight
 Description: Apache Arrow's RPC system built on gRPC
diff --git a/cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in 
b/cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in
index 6d4eab0b4a..4f8398bdd2 100644
--- a/cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in
+++ b/cpp/src/arrow/flight/sql/arrow-flight-sql.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Flight SQL
 Description: Apache Arrow Flight SQL extension
diff --git a/cpp/src/arrow/gpu/arrow-cuda.pc.in 
b/cpp/src/arrow/gpu/arrow-cuda.pc.in
index 858096f892..84c8c58898 100644
--- a/cpp/src/arrow/gpu/arrow-cuda.pc.in
+++ b/cpp/src/arrow/gpu/arrow-cuda.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow CUDA
 Description: CUDA integration library for Apache Arrow
diff --git a/cpp/src/arrow/json/arrow-json.pc.in 
b/cpp/src/arrow/json/arrow-json.pc.in
index ace2a07a3a..55a7cdda2f 100644
--- a/cpp/src/arrow/json/arrow-json.pc.in
+++ b/cpp/src/arrow/json/arrow-json.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow JSON
 Description: JSON reader module for Apache Arrow
diff --git a/cpp/src/arrow/python/arrow-python-flight.pc.in 
b/cpp/src/arrow/python/arrow-python-flight.pc.in
index fabed1b2d4..a98ad1fbf6 100644
--- a/cpp/src/arrow/python/arrow-python-flight.pc.in
+++ b/cpp/src/arrow/python/arrow-python-flight.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Python Flight
 Description: Python integration library for Apache Arrow Flight
diff --git a/cpp/src/arrow/python/arrow-python.pc.in 
b/cpp/src/arrow/python/arrow-python.pc.in
index 5293951987..c077c7dc84 100644
--- a/cpp/src/arrow/python/arrow-python.pc.in
+++ b/cpp/src/arrow/python/arrow-python.pc.in
@@ -15,8 +15,9 @@
 # specific language governing permissions and limitations
 # under the License.
 
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
+prefix=@CMAKE_INSTALL_PREFIX@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Apache Arrow Python
 Description: Python integration library for Apache Arrow
diff --git a/cpp/src/gandiva/gandiva.pc.in b/cpp/src/gandiva/gandiva.pc.in
index 22ff11a4ff..60034c2857 100644
--- a/cpp/src/gandiva/gandiva.pc.in
+++ b/cpp/src/gandiva/gandiva.pc.in
@@ -16,8 +16,8 @@
 # under the License.
 
 prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Gandiva
 Description: Gandiva is a toolset for compiling and evaluating expressions on 
Arrow data.
diff --git a/cpp/src/parquet/parquet.pc.in b/cpp/src/parquet/parquet.pc.in
index 3b29263a9d..e510bb1d6b 100644
--- a/cpp/src/parquet/parquet.pc.in
+++ b/cpp/src/parquet/parquet.pc.in
@@ -16,8 +16,8 @@
 # under the License.
 
 prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 so_version=@ARROW_SO_VERSION@
 abi_version=@ARROW_SO_VERSION@
diff --git a/cpp/src/plasma/PlasmaConfig.cmake.in 
b/cpp/src/plasma/PlasmaConfig.cmake.in
index 928b508763..b4b39afd0c 100644
--- a/cpp/src/plasma/PlasmaConfig.cmake.in
+++ b/cpp/src/plasma/PlasmaConfig.cmake.in
@@ -30,7 +30,7 @@
 include(CMakeFindDependencyMacro)
 find_dependency(Arrow)
 
-set(PLASMA_STORE_SERVER 
"@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/plasma-store-server@CMAKE_EXECUTABLE_SUFFIX@")
+set(PLASMA_STORE_SERVER 
"@CMAKE_INSTALL_FULL_BINDIR@/plasma-store-server@CMAKE_EXECUTABLE_SUFFIX@")
 
 # Load targets only once. If we load targets multiple times, CMake reports
 # already existent target error.
diff --git a/cpp/src/plasma/plasma.pc.in b/cpp/src/plasma/plasma.pc.in
index 17af015900..796321a0ad 100644
--- a/cpp/src/plasma/plasma.pc.in
+++ b/cpp/src/plasma/plasma.pc.in
@@ -16,13 +16,14 @@
 # under the License.
 
 prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/include
+bindir=@ARROW_PKG_CONFIG_BINDIR@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 so_version=@PLASMA_SO_VERSION@
 abi_version=@PLASMA_SO_VERSION@
 full_so_version=@PLASMA_FULL_SO_VERSION@
-plasma_store_server=${prefix}/@CMAKE_INSTALL_BINDIR@/plasma-store-server@CMAKE_EXECUTABLE_SUFFIX@
+plasma_store_server=${bindir}/plasma-store-server@CMAKE_EXECUTABLE_SUFFIX@
 executable=${plasma_store_server}
 
 Name: Plasma
diff --git a/cpp/src/skyhook/skyhook.pc.in b/cpp/src/skyhook/skyhook.pc.in
index a3a4da5ee9..8f7acfa979 100644
--- a/cpp/src/skyhook/skyhook.pc.in
+++ b/cpp/src/skyhook/skyhook.pc.in
@@ -16,11 +16,11 @@
 # under the License.
 
 prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
+libdir=@ARROW_PKG_CONFIG_LIBDIR@
 
 Name: Skyhook
 Description: Skyhook is a plugin for offloading computations into Ceph.
 Version: @SKYHOOK_VERSION@
 Requires: arrow_dataset
-Libs: -L${libdir} -larrow_skyhook_client
\ No newline at end of file
+Libs: -L${libdir} -larrow_skyhook_client

Reply via email to