Skip to content

Commit

Permalink
Install Find*.cmake only for enabled modules
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 3, 2019
1 parent 1b41a1f commit 53d1508
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 27 deletions.
17 changes: 5 additions & 12 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ endif()

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

set(ARROW_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")

set(ARROW_LLVM_VERSION "7.0")
# TODO: Remove this when we drop LLVM 7 support.
set(ARROW_LLVM_VERSION_FALLBACK "7.1")
Expand Down Expand Up @@ -828,29 +830,20 @@ export(EXPORT ${PROJECT_NAME}-targets
configure_package_config_file(ArrowConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/ArrowConfig.cmake"
INSTALL_DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
"${ARROW_CMAKE_INSTALL_DIR}")
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ArrowConfigVersion.cmake
VERSION ${${PROJECT_NAME}_VERSION}
COMPATIBILITY AnyNewerVersion)
config_summary_cmake_setters("${CMAKE_CURRENT_BINARY_DIR}/ArrowOptions.cmake")

install(EXPORT ${PROJECT_NAME}-targets
FILE ArrowTargets.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ArrowConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/ArrowConfigVersion.cmake
${CMAKE_CURRENT_BINARY_DIR}/ArrowOptions.cmake
${CMAKE_CURRENT_SOURCE_DIR}/arrow-config.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrow.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrowCUDA.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrowFlight.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrowDataset.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrowPython.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindArrowPythonFlight.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindGandiva.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindParquet.cmake
${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/FindPlasma.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")

config_summary_message()
if(${ARROW_BUILD_CONFIG_SUMMARY_JSON})
Expand Down
5 changes: 5 additions & 0 deletions cpp/cmake_modules/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -740,3 +740,8 @@ function(ARROW_ADD_PKG_CONFIG MODULE)
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${MODULE}.pc"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig/")
endfunction()

function(ARROW_INSTALL_CMAKE_FIND_MODULE MODULE)
install(FILES "${ARROW_SOURCE_DIR}/cmake_modules/Find${MODULE}.cmake"
DESTINATION "${ARROW_CMAKE_INSTALL_DIR}")
endfunction()
4 changes: 2 additions & 2 deletions cpp/src/arrow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,12 @@ if(ARROW_WITH_BACKTRACE)
endforeach()
endif()

# Headers: top level
arrow_install_all_headers("arrow")

# pkg-config support
arrow_add_pkg_config("arrow")

arrow_install_cmake_find_module("Arrow")

#
# Unit tests
#
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/dataset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

add_custom_target(arrow_dataset)

# Headers: top level
arrow_install_all_headers("arrow/dataset")

# pkg-config support
arrow_add_pkg_config("arrow-dataset")

arrow_install_cmake_find_module("ArrowDataset")

set(ARROW_DATASET_SRCS
dataset.cc
discovery.cc
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/arrow/flight/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@

add_custom_target(arrow_flight)

# Header files
arrow_install_all_headers("arrow/flight")

# pkg-config support
arrow_add_pkg_config("arrow-flight")

arrow_install_cmake_find_module("ArrowFlight")

set(ARROW_FLIGHT_STATIC_LINK_LIBS
protobuf::libprotobuf
gRPC::grpc++
Expand Down
3 changes: 3 additions & 0 deletions cpp/src/arrow/gpu/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/cuda_version.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/gpu")

arrow_install_all_headers("arrow/gpu")

arrow_add_pkg_config("arrow-cuda")

arrow_install_cmake_find_module("ArrowCUDA")

set(ARROW_CUDA_TEST_LINK_LIBS arrow_cuda_shared ${ARROW_TEST_LINK_LIBS})

if(ARROW_BUILD_TESTS)
Expand Down
6 changes: 4 additions & 2 deletions cpp/src/arrow/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ if(ARROW_FLIGHT AND ARROW_BUILD_SHARED)
target_compile_definitions(arrow_python_flight_static PUBLIC ARROW_STATIC)
endif()

# pkg-config support
arrow_add_pkg_config("arrow-python-flight")

arrow_install_cmake_find_module("ArrowPythonFlight")
endif()

if("${COMPILER_FAMILY}" STREQUAL "clang")
Expand All @@ -132,9 +133,10 @@ endif()

arrow_install_all_headers("arrow/python")

# pkg-config support
arrow_add_pkg_config("arrow-python")

arrow_install_cmake_find_module("ArrowPython")

# ----------------------------------------------------------------------

if(ARROW_BUILD_TESTS)
Expand Down
7 changes: 2 additions & 5 deletions cpp/src/gandiva/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,12 @@ endif()

add_dependencies(gandiva ${GANDIVA_LIBRARIES})

# install for gandiva
include(GNUInstallDirs)

# install the header files.
arrow_install_all_headers("gandiva")

# pkg-config support
arrow_add_pkg_config("gandiva")

arrow_install_cmake_find_module("Gandiva")

set(GANDIVA_STATIC_TEST_LINK_LIBS gandiva_static RE2::re2 ${ARROW_TEST_LINK_LIBS})

set(GANDIVA_SHARED_TEST_LINK_LIBS gandiva_shared RE2::re2 ${ARROW_TEST_LINK_LIBS})
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ configure_file(parquet_version.h.in "${CMAKE_CURRENT_BINARY_DIR}/parquet_version
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/parquet_version.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/parquet")

# pkg-config support
arrow_add_pkg_config("parquet")

arrow_install_cmake_find_module("Parquet")

add_parquet_test(internals-test
SOURCES
bloom_filter_test.cc
Expand Down
3 changes: 2 additions & 1 deletion cpp/src/plasma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,10 @@ set_target_properties(plasma-store-server PROPERTIES INSTALL_RPATH_USE_LINK_PATH
install(TARGETS plasma-store-server ${INSTALL_IS_OPTIONAL} DESTINATION
${CMAKE_INSTALL_BINDIR})

# pkg-config support
arrow_add_pkg_config("plasma")

arrow_install_cmake_find_module("Plasma")

if(ARROW_PLASMA_JAVA_CLIENT)
# Plasma java client support
find_package(JNI REQUIRED)
Expand Down

0 comments on commit 53d1508

Please sign in to comment.