Debian Codegraph @

podofo/cmake/modules/FindLibidn.cmake

raw
1 # - Find Libidn
2 # Find the native Libidn includes and library
3 #
4 # LIBIDN_INCLUDE_DIR - where to find stringprep.h, etc.
5 # LIBIDN_LIBRARIES - List of libraries when using libidn.
6 # LIBIDN_FOUND - True if libidn found.
7
8 if (LIBIDN_INCLUDE_DIR)
9 # Already in cache, be silent
10 set(LIBIDN_FIND_QUIETLY TRUE)
11 endif ()
12
13 find_path(LIBIDN_INCLUDE_DIR stringprep.h)
14
15 set(LIBIDN_LIBRARY_NAMES_RELEASE ${LIBIDN_LIBRARY_NAMES_RELEASE} ${LIBIDN_LIBRARY_NAMES} idn libidn)
16 find_library(LIBIDN_LIBRARY_RELEASE NAMES ${LIBIDN_LIBRARY_NAMES_RELEASE})
17
18 # Find a debug library if one exists and use that for debug builds.
19 # This really only does anything for win32, but does no harm on other
20 # platforms.
21 set(LIBIDN_LIBRARY_NAMES_DEBUG ${LIBIDN_LIBRARY_NAMES_DEBUG} idnd libidnd)
22 find_library(LIBIDN_LIBRARY_DEBUG NAMES ${LIBIDN_LIBRARY_NAMES_DEBUG})
23
24 include(LibraryDebugAndRelease)
25 set_library_from_debug_and_release(LIBIDN)
26
27 # handle the QUIETLY and REQUIRED arguments and set LIBIDN_FOUND to TRUE if
28 # all listed variables are TRUE
29 include(FindPackageHandleStandardArgs)
30 find_package_handle_standard_args(Libidn DEFAULT_MSG LIBIDN_LIBRARY LIBIDN_INCLUDE_DIR)
31
32 if(LIBIDN_FOUND)
33 set(LIBIDN_LIBRARIES ${LIBIDN_LIBRARY})
34 else()
35 set(LIBIDN_LIBRARIES)
36 endif()
37
38 mark_as_advanced(LIBIDN_LIBRARY LIBIDN_INCLUDE_DIR)