Skip to content

Commit 2da1f81

Browse files
committed
Fix target definition for older CMake versions
1 parent 8e0d416 commit 2da1f81

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cmake/FindIconv.cmake

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ else()
7676
endif()
7777

7878
if(Iconv_FOUND AND NOT TARGET Iconv::Iconv)
79-
add_library(Iconv::Iconv INTERFACE IMPORTED)
79+
if(Iconv_IS_BUILT_IN)
80+
add_library(Iconv::Iconv INTERFACE IMPORTED)
81+
else()
82+
add_library(Iconv::Iconv UNKNOWN IMPORTED)
83+
endif()
8084
if(NOT Iconv_IS_BUILT_IN AND Iconv_LIBRARY_RELEASE)
8185
set_property(TARGET Iconv::Iconv APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
8286
set_target_properties(Iconv::Iconv PROPERTIES IMPORTED_LOCATION_RELEASE "${Iconv_LIBRARY_RELEASE}")

0 commit comments

Comments
 (0)