Skip to content

Commit

Permalink
ARROW-440: [C++] Support pkg-config
Browse files Browse the repository at this point in the history
pkg-config is a tool to get build flags.

If Arrow supports pkg-config, users can set build flags easily.

For example, CMake supports pkg-config.

To support pkg-config, we just install .pc file that includes build
flags information.
  • Loading branch information
kou committed Dec 21, 2016
1 parent 268ffbe commit f2e62e4
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ install(FILES
test-util.h
DESTINATION include/arrow)

# pkg-config support
configure_file(arrow.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/arrow.pc"
@ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/arrow.pc"
DESTINATION "lib/pkgconfig/")

#######################################
# Unit tests
#######################################
Expand Down
9 changes: 9 additions & 0 deletions cpp/src/arrow/arrow.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: Apache Arrow
Description: Arrow is a set of technologies that enable big-data systems to process and move data fast.
Version: @ARROW_VERSION@
Libs: -L${libdir} -larrow
Cflags: -I${includedir}
8 changes: 8 additions & 0 deletions cpp/src/arrow/io/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,11 @@ install(FILES
install(TARGETS arrow_io
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

# pkg-config support
configure_file(arrow-io.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/arrow-io.pc"
@ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/arrow-io.pc"
DESTINATION "lib/pkgconfig/")
10 changes: 10 additions & 0 deletions cpp/src/arrow/io/arrow-io.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: Apache Arrow I/O
Description: I/O interface for Arrow.
Version: @ARROW_VERSION@
Libs: -L${libdir} -larrow_io
Cflags: -I${includedir}
Requires: arrow
8 changes: 8 additions & 0 deletions cpp/src/arrow/ipc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,3 +159,11 @@ install(FILES
install(TARGETS arrow_ipc
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)

# pkg-config support
configure_file(arrow-ipc.pc.in
"${CMAKE_CURRENT_BINARY_DIR}/arrow-ipc.pc"
@ONLY)
install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/arrow-ipc.pc"
DESTINATION "lib/pkgconfig/")
10 changes: 10 additions & 0 deletions cpp/src/arrow/ipc/arrow-ipc.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: Apache Arrow IPC
Description: IPC extension for Arrow.
Version: @ARROW_VERSION@
Libs: -L${libdir} -larrow_ipc
Cflags: -I${includedir}
Requires: arrow, arrow-io

0 comments on commit f2e62e4

Please sign in to comment.