Skip to content

Commit 3b3dfc0

Browse files
committed
CMake Configuration updates
1 parent 98cfac5 commit 3b3dfc0

File tree

6 files changed

+50
-53
lines changed

6 files changed

+50
-53
lines changed

cmake_modules/IcebergBuildUtils.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ function(add_iceberg_lib LIB_NAME)
150150
target_link_libraries(${LIB_NAME}_shared
151151
PUBLIC "$<BUILD_INTERFACE:iceberg_sanitizer_flags>")
152152

153+
string(TOUPPER ${LIB_NAME} VISIBILITY_NAME)
154+
target_compile_definitions(${LIB_NAME}_shared PRIVATE ${VISIBILITY_NAME}_EXPORTING)
155+
153156
install(TARGETS ${LIB_NAME}_shared
154157
EXPORT iceberg_targets
155158
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}
@@ -208,6 +211,8 @@ function(add_iceberg_lib LIB_NAME)
208211
target_link_libraries(${LIB_NAME}_static
209212
PUBLIC "$<BUILD_INTERFACE:iceberg_sanitizer_flags>")
210213

214+
string(TOUPPER ${LIB_NAME} VISIBILITY_NAME)
215+
target_compile_definitions(${LIB_NAME}_static PUBLIC ${VISIBILITY_NAME}_STATIC)
211216
install(TARGETS ${LIB_NAME}_static
212217
EXPORT iceberg_targets
213218
ARCHIVE DESTINATION ${INSTALL_ARCHIVE_DIR}

cmake_modules/IcebergThirdpartyToolchain.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ function(resolve_cpr_dependency)
461461
set(CPR_VENDORED TRUE)
462462
set_target_properties(cpr PROPERTIES OUTPUT_NAME "iceberg_vendored_cpr"
463463
POSITION_INDEPENDENT_CODE ON)
464-
add_library(Iceberg::cpr ALIAS cpr)
464+
add_library(iceberg::cpr ALIAS cpr)
465465
install(TARGETS cpr
466466
EXPORT iceberg_targets
467467
RUNTIME DESTINATION "${ICEBERG_INSTALL_BINDIR}"

example/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ project(example)
2222

2323
set(CMAKE_CXX_STANDARD 23)
2424

25-
find_package(Iceberg CONFIG REQUIRED)
25+
find_package(iceberg CONFIG REQUIRED)
2626

2727
add_executable(demo_example demo_example.cc)
2828

29-
target_link_libraries(demo_example PRIVATE Iceberg::iceberg_bundle_static
30-
Iceberg::iceberg_rest_static)
29+
target_link_libraries(demo_example PRIVATE iceberg::iceberg_bundle_static
30+
iceberg::iceberg_rest_static)

src/iceberg/CMakeLists.txt

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ list(APPEND
7676
ZLIB::ZLIB)
7777
list(APPEND
7878
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
79-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
80-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,Iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
81-
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,roaring::roaring>"
82-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
79+
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
80+
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
81+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
82+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
8383
list(APPEND
8484
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
85-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
86-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,Iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
87-
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,roaring::roaring>"
88-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
85+
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
86+
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
87+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
88+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
8989

9090
add_iceberg_lib(iceberg
9191
SOURCES
@@ -155,17 +155,17 @@ if(ICEBERG_BUILD_BUNDLE)
155155

156156
list(APPEND
157157
ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS
158-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
159-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
160-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>>"
161-
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>"
158+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_static>,iceberg::iceberg_static,iceberg::iceberg_shared>"
159+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
160+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>>"
161+
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>"
162162
)
163163
list(APPEND
164164
ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS
165-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
166-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
167-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>>"
168-
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>"
165+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_shared>,iceberg::iceberg_shared,iceberg::iceberg_static>"
166+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
167+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>>"
168+
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>"
169169
)
170170

171171
add_iceberg_lib(iceberg_bundle
@@ -182,20 +182,12 @@ if(ICEBERG_BUILD_BUNDLE)
182182
OUTPUTS
183183
ICEBERG_BUNDLE_LIBRARIES)
184184

185-
foreach(LIB_TARGET ${ICEBERG_BUNDLE_LIBRARIES})
186-
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_BUNDLE_EXPORTING)
187-
endforeach()
188-
189-
if(ICEBERG_BUILD_STATIC)
190-
target_compile_definitions(iceberg_bundle_static PUBLIC ICEBERG_BUNDLE_STATIC)
191-
endif()
192-
193185
add_subdirectory(arrow)
194186
add_subdirectory(avro)
195187
add_subdirectory(parquet)
196188
endif()
197189

198-
iceberg_install_cmake_package(Iceberg iceberg_targets)
190+
iceberg_install_cmake_package(iceberg iceberg_targets)
199191

200192
if(ICEBERG_BUILD_TESTS)
201193
add_subdirectory(test)

src/iceberg/catalog/rest/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ list(APPEND ICEBERG_REST_SHARED_BUILD_INTERFACE_LIBS
2828
"$<IF:$<TARGET_EXISTS:iceberg_shared>,iceberg_shared,iceberg_static>" cpr::cpr)
2929
list(APPEND
3030
ICEBERG_REST_STATIC_INSTALL_INTERFACE_LIBS
31-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
32-
"$<IF:$<BOOL:${CPR_VENDORED}>,Iceberg::cpr,cpr::cpr>")
31+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_static>,iceberg::iceberg_static,iceberg::iceberg_shared>"
32+
"$<IF:$<BOOL:${CPR_VENDORED}>,iceberg::cpr,cpr::cpr>")
3333
list(APPEND
3434
ICEBERG_REST_SHARED_INSTALL_INTERFACE_LIBS
35-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
36-
"$<IF:$<BOOL:${CPR_VENDORED}>,Iceberg::cpr,cpr::cpr>")
35+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_shared>,iceberg::iceberg_shared,iceberg::iceberg_static>"
36+
"$<IF:$<BOOL:${CPR_VENDORED}>,iceberg::cpr,cpr::cpr>")
3737

3838
add_iceberg_lib(iceberg_rest
3939
SOURCES

src/iceberg/IcebergConfig.cmake.in renamed to src/iceberg/icebergConfig.cmake.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
#
2323
# This config sets the following targets (if built) in your project::
2424
#
25-
# Iceberg::iceberg_shared
26-
# Iceberg::iceberg_static
27-
# Iceberg::iceberg_bundle_shared
28-
# Iceberg::iceberg_bundle_static
29-
# Iceberg::iceberg_rest_shared
30-
# Iceberg::iceberg_rest_static
25+
# iceberg::iceberg_shared
26+
# iceberg::iceberg_static
27+
# iceberg::iceberg_bundle_shared
28+
# iceberg::iceberg_bundle_static
29+
# iceberg::iceberg_rest_shared
30+
# iceberg::iceberg_rest_static
3131

3232
@PACKAGE_INIT@
3333

@@ -59,12 +59,12 @@ endmacro()
5959
macro(iceberg_find_components components)
6060
foreach(comp ${components})
6161
string(TOLOWER "${comp}" _comp_lower_case)
62-
if(TARGET "Iceberg::iceberg_${_comp_lower_case}_shared" OR
63-
TARGET "Iceberg::iceberg_${_comp_lower_case}_static")
64-
set(Iceberg_${comp}_FOUND TRUE)
62+
if(TARGET "iceberg::iceberg_${_comp_lower_case}_shared" OR
63+
TARGET "iceberg::iceberg_${_comp_lower_case}_static")
64+
set(iceberg_${comp}_FOUND TRUE)
6565
else()
66-
set(Iceberg_${comp}_FOUND FALSE)
67-
set(Iceberg_NOT_FOUND_MESSAGE "Component ${comp} was not installed")
66+
set(iceberg_${comp}_FOUND FALSE)
67+
set(iceberg_NOT_FOUND_MESSAGE "Component ${comp} was not installed")
6868
endif()
6969
endforeach()
7070
endmacro()
@@ -85,17 +85,17 @@ if(NOT TARGET CURL::libcurl)
8585
add_library(CURL::libcurl INTERFACE IMPORTED)
8686
endif()
8787

88-
include("${CMAKE_CURRENT_LIST_DIR}/IcebergTargets.cmake")
88+
include("${CMAKE_CURRENT_LIST_DIR}/icebergTargets.cmake")
8989

90-
if(TARGET Iceberg::arrow_static)
91-
add_library(Arrow::arrow_static ALIAS Iceberg::arrow_static)
90+
if(TARGET iceberg::arrow_static)
91+
add_library(Arrow::arrow_static ALIAS iceberg::arrow_static)
9292

9393
add_library(Arrow::arrow_bundled_dependencies STATIC IMPORTED)
94-
get_target_property(arrow_static_configurations Iceberg::arrow_static
94+
get_target_property(arrow_static_configurations iceberg::arrow_static
9595
IMPORTED_CONFIGURATIONS)
9696
foreach(CONFIGURATION ${arrow_static_configurations})
9797
string(TOUPPER "${CONFIGURATION}" CONFIGURATION)
98-
get_target_property(arrow_static_location Iceberg::arrow_static
98+
get_target_property(arrow_static_location iceberg::arrow_static
9999
LOCATION_${CONFIGURATION})
100100
get_filename_component(arrow_lib_dir "${arrow_static_location}" DIRECTORY)
101101
set_property(TARGET Arrow::arrow_bundled_dependencies
@@ -108,11 +108,11 @@ if(TARGET Iceberg::arrow_static)
108108
endforeach()
109109
endif()
110110

111-
if(TARGET Iceberg::parquet_static)
112-
add_library(Parquet::parquet_static ALIAS Iceberg::parquet_static)
111+
if(TARGET iceberg::parquet_static)
112+
add_library(Parquet::parquet_static ALIAS iceberg::parquet_static)
113113
endif()
114114

115115
# Find required components
116-
iceberg_find_components("${Iceberg_FIND_COMPONENTS}")
116+
iceberg_find_components("${iceberg_FIND_COMPONENTS}")
117117

118-
check_required_components(Iceberg)
118+
check_required_components(iceberg)

0 commit comments

Comments
 (0)