4 # Finds the ICONV library
6 # This will define the following targets:
8 # ${APP_NAME_LC}::Iconv - An alias of the Iconv::Iconv target
9 # Iconv::Iconv - The ICONV library
11 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
13 # We do this dance to utilise cmake system FindIconv. Saves us dealing with it
14 set(_temp_CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
15 unset(CMAKE_MODULE_PATH)
17 if(Iconv_FIND_REQUIRED)
18 set(ICONV_REQUIRED "REQUIRED")
21 find_package(Iconv ${ICONV_REQUIRED})
23 # Back to our normal module paths
24 set(CMAKE_MODULE_PATH ${_temp_CMAKE_MODULE_PATH})
27 # We still want to Alias its "standard" target to our APP_NAME_LC based target
28 # for integration into our core dep packaging
29 add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} ALIAS Iconv::Iconv)
31 if(Iconv_FIND_REQUIRED)
32 message(FATAL_ERROR "Iconv libraries were not found.")