Skip to content

Commit

Permalink
cmake: Add check for iconv support
Browse files Browse the repository at this point in the history
popt can optionally use iconv to support an expanded set of encodings,
so we should detect and enable this when available.
  • Loading branch information
Conan-Kudo committed Jan 18, 2023
1 parent 0788cb2 commit 975cf4b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ foreach(inchdr ${OPTINCS})
chkhdr(${inchdr} FALSE)
endforeach()

find_package(Iconv)

if (Iconv_FOUND)
add_compile_definitions(HAVE_ICONV)
endif()

add_subdirectory(src)
add_subdirectory(po)
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ target_include_directories(popt PUBLIC
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_link_libraries(popt PRIVATE Iconv::Iconv)

set_target_properties(popt PROPERTIES
VERSION ${PROJECT_VERSION}
SOVERSION ${POPT_SOVERSION}
Expand Down

0 comments on commit 975cf4b

Please sign in to comment.