Skip to content

Commit 873615b

Browse files
committed
CMake Configuration updates
1 parent 87c6f22 commit 873615b

6 files changed

Lines changed: 50 additions & 53 deletions

File tree

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
@@ -83,16 +83,16 @@ list(APPEND
8383
ZLIB::ZLIB)
8484
list(APPEND
8585
ICEBERG_STATIC_INSTALL_INTERFACE_LIBS
86-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
87-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,Iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
88-
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,roaring::roaring>"
89-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
86+
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_static,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_static>,nanoarrow::nanoarrow_static,nanoarrow::nanoarrow_shared>>"
87+
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
88+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
89+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
9090
list(APPEND
9191
ICEBERG_SHARED_INSTALL_INTERFACE_LIBS
92-
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,Iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
93-
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,Iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
94-
"$<IF:$<BOOL:${CROARING_VENDORED}>,Iceberg::roaring,roaring::roaring>"
95-
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,Iceberg::spdlog,spdlog::spdlog>")
92+
"$<IF:$<BOOL:${NANOARROW_VENDORED}>,iceberg::nanoarrow_shared,$<IF:$<TARGET_EXISTS:nanoarrow::nanoarrow_shared>,nanoarrow::nanoarrow_shared,nanoarrow::nanoarrow_static>>"
93+
"$<IF:$<BOOL:${NLOHMANN_JSON_VENDORED}>,iceberg::nlohmann_json,$<IF:$<TARGET_EXISTS:nlohmann_json::nlohmann_json>,nlohmann_json::nlohmann_json,nlohmann_json::nlohmann_json>>"
94+
"$<IF:$<BOOL:${CROARING_VENDORED}>,iceberg::roaring,roaring::roaring>"
95+
"$<IF:$<BOOL:${SPDLOG_VENDORED}>,iceberg::spdlog,spdlog::spdlog>")
9696

9797
add_iceberg_lib(iceberg
9898
SOURCES
@@ -163,17 +163,17 @@ if(ICEBERG_BUILD_BUNDLE)
163163

164164
list(APPEND
165165
ICEBERG_BUNDLE_STATIC_INSTALL_INTERFACE_LIBS
166-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_static>,Iceberg::iceberg_static,Iceberg::iceberg_shared>"
167-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
168-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>>"
169-
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>"
166+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_static>,iceberg::iceberg_static,iceberg::iceberg_shared>"
167+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_static>,Arrow::arrow_static,Arrow::arrow_shared>>"
168+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_static>,Parquet::parquet_static,Parquet::parquet_shared>>"
169+
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_static>,avro-cpp::avrocpp_static,avro-cpp::avrocpp_shared>>"
170170
)
171171
list(APPEND
172172
ICEBERG_BUNDLE_SHARED_INSTALL_INTERFACE_LIBS
173-
"$<IF:$<TARGET_EXISTS:Iceberg::iceberg_shared>,Iceberg::iceberg_shared,Iceberg::iceberg_static>"
174-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
175-
"$<IF:$<BOOL:${ARROW_VENDORED}>,Iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>>"
176-
"$<IF:$<BOOL:${AVRO_VENDORED}>,Iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>"
173+
"$<IF:$<TARGET_EXISTS:iceberg::iceberg_shared>,iceberg::iceberg_shared,iceberg::iceberg_static>"
174+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::arrow_static,$<IF:$<TARGET_EXISTS:Arrow::arrow_shared>,Arrow::arrow_shared,Arrow::arrow_static>>"
175+
"$<IF:$<BOOL:${ARROW_VENDORED}>,iceberg::parquet_static,$<IF:$<TARGET_EXISTS:Parquet::parquet_shared>,Parquet::parquet_shared,Parquet::parquet_static>>"
176+
"$<IF:$<BOOL:${AVRO_VENDORED}>,iceberg::avrocpp_s,$<IF:$<TARGET_EXISTS:avro-cpp::avrocpp_shared>,avro-cpp::avrocpp_shared,avro-cpp::avrocpp_static>>"
177177
)
178178

179179
add_iceberg_lib(iceberg_bundle
@@ -190,20 +190,12 @@ if(ICEBERG_BUILD_BUNDLE)
190190
OUTPUTS
191191
ICEBERG_BUNDLE_LIBRARIES)
192192

193-
foreach(LIB_TARGET ${ICEBERG_BUNDLE_LIBRARIES})
194-
target_compile_definitions(${LIB_TARGET} PRIVATE ICEBERG_BUNDLE_EXPORTING)
195-
endforeach()
196-
197-
if(ICEBERG_BUILD_STATIC)
198-
target_compile_definitions(iceberg_bundle_static PUBLIC ICEBERG_BUNDLE_STATIC)
199-
endif()
200-
201193
add_subdirectory(arrow)
202194
add_subdirectory(avro)
203195
add_subdirectory(parquet)
204196
endif()
205197

206-
iceberg_install_cmake_package(Iceberg iceberg_targets)
198+
iceberg_install_cmake_package(iceberg iceberg_targets)
207199

208200
if(ICEBERG_BUILD_TESTS)
209201
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
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)