diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2023-10-23 04:04:09 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2023-10-23 04:04:09 +0200 |
commit | e0827ea544d475622ed6b7a10e201fd93cae4251 (patch) | |
tree | 8d9b881f5877cc5907ff5548f882f7df2225682b /ConfigureChecks.cmake | |
parent | 3de53226da36ff255ac18118b0f54d608fabc16c (diff) | |
download | libksquirrel-e0827ea544d475622ed6b7a10e201fd93cae4251.tar.gz libksquirrel-e0827ea544d475622ed6b7a10e201fd93cae4251.zip |
cmake: Add detection of standalone iconv library.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 5914777..d8fe7e1 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -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( ) |