Skip to content

Commit a242eb1

Browse files
committed
ARROW-16585: [C++] Add support for absolute CMAKE_INSTALL_*DIR
Closes #13182 from kou/cpp-pkg-config-path Authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 79810a5 commit a242eb1

22 files changed

Lines changed: 77 additions & 41 deletions

cpp/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ include(ExternalProject)
104104
include(FindPackageHandleStandardArgs)
105105

106106
include(GNUInstallDirs)
107+
if(IS_ABSOLUTE "${CMAKE_INSTALL_BINDIR}")
108+
set(ARROW_PKG_CONFIG_BINDIR "${CMAKE_INSTALL_BINDIR}")
109+
else()
110+
set(ARROW_PKG_CONFIG_BINDIR "\${prefix}/${CMAKE_INSTALL_BINDIR}")
111+
endif()
112+
if(IS_ABSOLUTE "${CMAKE_INSTALL_INCLUDEDIR}")
113+
set(ARROW_PKG_CONFIG_INCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}")
114+
else()
115+
set(ARROW_PKG_CONFIG_INCLUDEDIR "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}")
116+
endif()
117+
if(IS_ABSOLUTE "${CMAKE_INSTALL_LIBDIR}")
118+
set(ARROW_PKG_CONFIG_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
119+
else()
120+
set(ARROW_PKG_CONFIG_LIBDIR "\${prefix}/${CMAKE_INSTALL_LIBDIR}")
121+
endif()
107122

108123
set(BUILD_SUPPORT_DIR "${CMAKE_SOURCE_DIR}/build-support")
109124

cpp/src/arrow/adapters/orc/arrow-orc.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow ORC
2223
Description: ORC modules for Apache Arrow

cpp/src/arrow/adapters/tensorflow/arrow-tensorflow.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow Tensorflow
2223
Description: TensorFlow modules for Apache Arrow

cpp/src/arrow/arrow-testing.pc.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
21+
2022
gtest_includedir=@GTEST_INCLUDE_DIR@
2123

2224
Name: Apache Arrow testing

cpp/src/arrow/arrow.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
so_version=@ARROW_SO_VERSION@
2223
abi_version=@ARROW_SO_VERSION@

cpp/src/arrow/compute/arrow-compute.pc.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
21+
1822
Name: Apache Arrow Compute
1923
Description: Compute modules for Apache Arrow
2024
Version: @ARROW_VERSION@

cpp/src/arrow/csv/arrow-csv.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow CSV
2223
Description: CSV reader module for Apache Arrow

cpp/src/arrow/dataset/arrow-dataset.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow Dataset
2223
Description: Apache Arrow Dataset provides an API to read and write semantic datasets stored in different locations and formats.

cpp/src/arrow/engine/arrow-substrait.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow Substrait Consumer
2223
Description: Apache Arrow's Substrait Consumer.

cpp/src/arrow/filesystem/arrow-filesystem.pc.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
libdir=@CMAKE_INSTALL_FULL_LIBDIR@
19-
includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
18+
prefix=@CMAKE_INSTALL_PREFIX@
19+
includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@
20+
libdir=@ARROW_PKG_CONFIG_LIBDIR@
2021

2122
Name: Apache Arrow Filesystem
2223
Description: Filesystem API for accessing local and remote filesystems

0 commit comments

Comments
 (0)