cmake: Add detection of standalone iconv library.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/10/head
Slávek Banko 1 year ago
parent 3de53226da
commit e0827ea544
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -337,9 +337,25 @@ if( BUILD_XCF )
check_include_file( "iconv.h" HAVE_ICONV_H )
if( NOT HAVE_ICONV_H )
tde_message_fatal( "xcf codec was requested but libiconv not found on your system" )
tde_message_fatal( "xcf codec was requested but iconv header not found on your system" )
endif( )
set( HAVE_ICONV 1 )
message( STATUS "Check for standalone libiconv" )
find_library( HAVE_LIBICONV iconv )
if( HAVE_LIBICONV )
set( ICONV_LIBRARIES iconv )
message( STATUS "Check for standalone libiconv - found" )
else( )
set( ICONV_LIBRARIES "" )
message( STATUS "Check for standalone libiconv - not found" )
endif( )
tde_save_and_set( CMAKE_REQUIRED_LIBRARIES "${ICONV_LIBRARIES}" )
check_function_exists( "iconv_open" HAVE_ICONV )
tde_restore( CMAKE_REQUIRED_LIBRARIES )
if( NOT HAVE_ICONV )
tde_message_fatal( "xcf codec was requested but iconv library not found on your system" )
endif()
endif( )

@ -10,5 +10,6 @@ include_directories(
file( GLOB _bin_c_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.c )
tde_add_executable( ksquirrel-libs-xcf2pnm
SOURCES ${_bin_c_files}
LINK ${ICONV_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)

Loading…
Cancel
Save