File tree Expand file tree Collapse file tree 4 files changed +24
-20
lines changed Expand file tree Collapse file tree 4 files changed +24
-20
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ endif()
2323
2424list (APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR} /cmake_modules" )
2525
26- project (iceberg
26+ project (Iceberg
2727 VERSION 0.1.0
2828 DESCRIPTION "Iceberg C++ Project"
2929 LANGUAGES CXX)
Original file line number Diff line number Diff line change 1818# Borrowed the file from Apache Arrow:
1919# https://github.com/apache/arrow/blob/main/cpp/cmake_modules/BuildUtils.cmake
2020
21+ include (CMakePackageConfigHelpers)
22+
23+ function (iceberg_install_cmake_package PACKAGE_NAME EXPORT_NAME)
24+ set (CONFIG_CMAKE "${PACKAGE_NAME} Config.cmake" )
25+ set (BUILT_CONFIG_CMAKE "${CMAKE_CURRENT_BINARY_DIR} /${CONFIG_CMAKE} " )
26+ configure_package_config_file("${CONFIG_CMAKE} .in" "${BUILT_CONFIG_CMAKE} "
27+ INSTALL_DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /${PACKAGE_NAME} "
28+ )
29+ set (CONFIG_VERSION_CMAKE "${PACKAGE_NAME} ConfigVersion.cmake" )
30+ set (BUILT_CONFIG_VERSION_CMAKE "${CMAKE_CURRENT_BINARY_DIR} /${CONFIG_VERSION_CMAKE} " )
31+ write_basic_package_version_file("${BUILT_CONFIG_VERSION_CMAKE} "
32+ COMPATIBILITY SameMajorVersion)
33+ install (FILES "${BUILT_CONFIG_CMAKE} " "${BUILT_CONFIG_VERSION_CMAKE} "
34+ DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /${PACKAGE_NAME} " )
35+ set (TARGETS_CMAKE "${PACKAGE_NAME} Targets.cmake" )
36+ install (EXPORT ${EXPORT_NAME}
37+ DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /${PACKAGE_NAME} "
38+ NAMESPACE "${PACKAGE_NAME} ::"
39+ FILE "${TARGETS_CMAKE} " )
40+ endfunction ()
41+
2142function (ADD_ICEBERG_LIB LIB_NAME)
2243 set (options )
2344 set (one_value_args
Original file line number Diff line number Diff line change @@ -19,21 +19,4 @@ add_subdirectory(arrow)
1919add_subdirectory (core)
2020add_subdirectory (puffin)
2121
22- include (CMakePackageConfigHelpers)
23-
24- configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR} /config.cmake.in"
25- "${CMAKE_CURRENT_BINARY_DIR} /iceberg-config.cmake"
26- INSTALL_DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /Iceberg" )
27-
28- write_basic_package_version_file(
29- "${CMAKE_CURRENT_BINARY_DIR} /iceberg-config-version.cmake"
30- COMPATIBILITY SameMajorVersion)
31-
32- install (EXPORT iceberg_targets
33- DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /Iceberg"
34- NAMESPACE "Iceberg::"
35- FILE "iceberg-targets.cmake" )
36-
37- install (FILES "${CMAKE_CURRENT_BINARY_DIR} /iceberg-config.cmake"
38- "${CMAKE_CURRENT_BINARY_DIR} /iceberg-config-version.cmake"
39- DESTINATION "${ICEBERG_INSTALL_CMAKEDIR} /Iceberg" )
22+ iceberg_install_cmake_package(Iceberg iceberg_targets)
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ macro(iceberg_find_components components)
6969 endforeach ()
7070endmacro ()
7171
72- include ("${CMAKE_CURRENT_LIST_DIR} /iceberg-targets .cmake" )
72+ include ("${CMAKE_CURRENT_LIST_DIR} /IcebergTargets .cmake" )
7373
7474# Find required components
7575iceberg_find_components("${Iceberg_FIND_COMPONENTS} " )
You can’t perform that action at this time.
0 commit comments