Skip to content

Commit 2cfd715

Browse files
committed
use internal cmake variables
1 parent f84b307 commit 2cfd715

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

src/config.cmake.in

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,14 @@ macro(iceberg_find_dependencies dependencies)
5858
endmacro()
5959

6060
macro(iceberg_find_components components)
61-
file(GLOB_RECURSE target_cmake_files "${CMAKE_CURRENT_LIST_DIR}/*-targets.cmake")
62-
foreach(target_cmake_file ${target_cmake_files})
63-
include(${target_cmake_file})
61+
file(GLOB_RECURSE _target_cmake_files "${CMAKE_CURRENT_LIST_DIR}/*-targets.cmake")
62+
foreach(_target_cmake_file ${_target_cmake_files})
63+
include(${_target_cmake_file})
6464
endforeach()
6565

6666
foreach(comp ${components})
67-
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/iceberg-${comp}-targets.cmake")
67+
string(TOLOWER "${comp}" _comp_lower_case)
68+
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/iceberg-${_comp_lower_case}-targets.cmake")
6869
set(Iceberg_${comp}_FOUND TRUE)
6970
else()
7071
set(Iceberg_${comp}_FOUND FALSE)
@@ -74,36 +75,36 @@ macro(iceberg_find_components components)
7475
endmacro()
7576

7677
macro(iceberg_find_vendor_dependencies dependencies)
77-
get_target_property(iceberg_static_configurations
78+
get_target_property(_iceberg_static_configurations
7879
Iceberg::iceberg_core_static IMPORTED_CONFIGURATIONS)
7980

8081
foreach(dependency ${dependencies})
81-
string(REPLACE "|" ";" dependency_pair ${dependency})
82-
list(LENGTH dependency_pair dependency_pair_length)
83-
if(NOT dependency_pair_length EQUAL 2)
82+
string(REPLACE "|" ";" _dependency_pair ${dependency})
83+
list(LENGTH _dependency_pair _dependency_pair_length)
84+
if(NOT _dependency_pair_length EQUAL 2)
8485
message(FATAL_ERROR "Invalid vendor dependency: ${dependency}")
8586
endif()
86-
list(GET dependency_pair 0 target_name)
87-
list(GET dependency_pair 1 static_lib_name)
87+
list(GET _dependency_pair 0 _target_name)
88+
list(GET _dependency_pair 1 _static_lib_name)
8889

89-
add_library("${target_name}" STATIC IMPORTED)
90+
add_library("${_target_name}" STATIC IMPORTED)
9091

91-
foreach(configuration ${iceberg_static_configurations})
92-
string(TOUPPER "${configuration}" CONFIGURATION)
92+
foreach(configuration ${_iceberg_static_configurations})
93+
string(TOUPPER "${configuration}" _configuration_upper_case)
9394
get_target_property(
94-
iceberg_core_static_location
95-
Iceberg::iceberg_core_static LOCATION_${CONFIGURATION})
95+
_iceberg_core_static_location
96+
Iceberg::iceberg_core_static LOCATION_${_configuration_upper_case})
9697
get_filename_component(
9798
iceberg_core_lib_dir
98-
"${iceberg_core_static_location}" DIRECTORY)
99+
"${_iceberg_core_static_location}" DIRECTORY)
99100
set_property(
100-
TARGET "${target_name}"
101+
TARGET "${_target_name}"
101102
APPEND
102-
PROPERTY IMPORTED_CONFIGURATIONS ${CONFIGURATION})
103+
PROPERTY IMPORTED_CONFIGURATIONS ${_configuration_upper_case})
103104
set_target_properties(
104-
"${target_name}"
105-
PROPERTIES IMPORTED_LOCATION_${CONFIGURATION}
106-
"${iceberg_core_lib_dir}/${static_lib_name}")
105+
"${_target_name}"
106+
PROPERTIES IMPORTED_LOCATION_${_configuration_upper_case}
107+
"${iceberg_core_lib_dir}/${_static_lib_name}")
107108
endforeach()
108109
endforeach()
109110
endmacro()

0 commit comments

Comments
 (0)