From 326551ee020e0df846c9f0454faef5bcc0334e17 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 20 Jul 2017 01:25:13 +0200 Subject: [PATCH] Allow to force use of external iconv --- cmake/modules/3rdParty.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/modules/3rdParty.cmake b/cmake/modules/3rdParty.cmake index bd166ff..c6036c5 100644 --- a/cmake/modules/3rdParty.cmake +++ b/cmake/modules/3rdParty.cmake @@ -208,10 +208,13 @@ if(NOT DEFINED THIRD_PARTY_MODULE_LOADED) endmacro() macro(use_iconv LINKAGE REQUIRED) - # check whether iconv exists in the standard library - include(CheckFunctionExists) - check_function_exists(iconv HAS_ICONV) - if(HAS_ICONV) + set(FORCE_EXTERNAL_ICONV OFF CACHE PATH "whether to force usage of external iconv (rather than the using the one bundled with glibc)") + if(NOT FORCE_EXTERNAL_ICONV) + # check whether iconv exists in standard lib + include(CheckFunctionExists) + check_function_exists(iconv HAS_ICONV) + endif() + if(NOT FORCE_EXTERNAL_ICONV AND HAS_ICONV) message(STATUS "Using iconv from the standard library for ${META_PROJECT_NAME}.") else() # find external iconv library