TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags
[wireshark-sm.git] / cmake / modules / FindWSLibrary.cmake
blobc5c06ece37f4d40d3c9573dfec7735dc968c5abf
2 # - Find WS Library
3 #  This function is a wrapper for find_library() that does handle vcpkg exported
4 #  library directory structure
6 function(FindWSLibrary OUTPUT_LIBRARY)
7     cmake_parse_arguments(
8         WS_LIB
9         ""
10         "WIN32_HINTS"
11         "NAMES;HINTS;PATHS"
12         ${ARGN}
13     )
15     if (WIN32)
16         find_library(${OUTPUT_LIBRARY}_DEBUG
17             NAMES ${WS_LIB_NAMES}
18             HINTS "${WS_LIB_WIN32_HINTS}/debug/lib"
19             PATHS ${WS_LIB_PATHS}
20         )
21         find_library(${OUTPUT_LIBRARY}_RELEASE
22             NAMES ${WS_LIB_NAMES}
23             HINTS "${WS_LIB_WIN32_HINTS}/lib"
24             PATHS ${WS_LIB_PATHS}
25         )
27         if (${OUTPUT_LIBRARY}_DEBUG AND ${OUTPUT_LIBRARY}_RELEASE)
28             set(${OUTPUT_LIBRARY} debug ${${OUTPUT_LIBRARY}_DEBUG} optimized ${${OUTPUT_LIBRARY}_RELEASE} PARENT_SCOPE)
29         endif()
30     else()
31         find_library(${OUTPUT_LIBRARY}
32             NAMES ${WS_LIB_NAMES}
33             HINTS ${WS_LIB_HINTS}
34             PATHS ${WS_LIB_PATHS}
35         )
36     endif()
37 endfunction()