# cmake macro to test IDN library # Copyright (c) 2006, Will Stephenson # # IDN_FOUND - Test has found IDN dependencies # IDN_INCLUDE_DIR - Include needed for IDN # IDN_LIBRARIES - Libraries needed for IDN # IDN_DEFINITIONS - Compiler swithces required for using IDN # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. if (IDN_INCLUDE_DIR AND IDN_LIBRARIES) # in cache set(IDN_FIND_QUIETLY TRUE) endif (IDN_INCLUDE_DIR AND IDN_LIBRARIES) if (NOT WIN32) FIND_PACKAGE(PkgConfig) PKG_CHECK_MODULES(PC_IDN libidn) set(IDN_DEFINITIONS ${PC_IDN_CFLAGS_OTHER}) endif (NOT WIN32) find_path(IDN_INCLUDE_DIR idna.h HINTS ${PC_IDN_INCLUDEDIR} ${PC_IDN_INCLUDE_DIRS} ) find_library(IDN_LIBRARIES NAMES idn libidn idn-11 libidn-11 HINTS ${PC_IDN_LIBDIR} ${PC_IDN_LIBRARY_DIRS} ) if (IDN_INCLUDE_DIR AND IDN_LIBRARIES) set(IDN_FOUND TRUE) else (IDN_INCLUDE_DIR AND IDN_LIBRARIES) set(IDN_FOUND FALSE) endif (IDN_INCLUDE_DIR AND IDN_LIBRARIES) if (IDN_FOUND) if (NOT IDN_FIND_QUIETLY) message("Found IDN libraries: ${IDN_LIBRARIES}") endif (NOT IDN_FIND_QUIETLY) else (IDN_FOUND) message(FATAL_ERROR "Required libidn not found") endif (IDN_FOUND) MARK_AS_ADVANCED(IDN_INCLUDE_DIR IDN_LIBRARIES)