diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 20:34:10 +0000 |
commit | e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc (patch) | |
tree | 68cb5ef9081156392f1dd62a00c6ccc1451b93df /cmake/modules/FindWSLibrary.cmake | |
parent | Initial commit. (diff) | |
download | wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.tar.xz wireshark-e4ba6dbc3f1e76890b22773807ea37fe8fa2b1bc.zip |
Adding upstream version 4.2.2.upstream/4.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindWSLibrary.cmake')
-rw-r--r-- | cmake/modules/FindWSLibrary.cmake | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/cmake/modules/FindWSLibrary.cmake b/cmake/modules/FindWSLibrary.cmake new file mode 100644 index 00000000..c5c06ece --- /dev/null +++ b/cmake/modules/FindWSLibrary.cmake @@ -0,0 +1,37 @@ +# +# - Find WS Library +# This function is a wrapper for find_library() that does handle vcpkg exported +# library directory structure + +function(FindWSLibrary OUTPUT_LIBRARY) + cmake_parse_arguments( + WS_LIB + "" + "WIN32_HINTS" + "NAMES;HINTS;PATHS" + ${ARGN} + ) + + if (WIN32) + find_library(${OUTPUT_LIBRARY}_DEBUG + NAMES ${WS_LIB_NAMES} + HINTS "${WS_LIB_WIN32_HINTS}/debug/lib" + PATHS ${WS_LIB_PATHS} + ) + find_library(${OUTPUT_LIBRARY}_RELEASE + NAMES ${WS_LIB_NAMES} + HINTS "${WS_LIB_WIN32_HINTS}/lib" + PATHS ${WS_LIB_PATHS} + ) + + if (${OUTPUT_LIBRARY}_DEBUG AND ${OUTPUT_LIBRARY}_RELEASE) + set(${OUTPUT_LIBRARY} debug ${${OUTPUT_LIBRARY}_DEBUG} optimized ${${OUTPUT_LIBRARY}_RELEASE} PARENT_SCOPE) + endif() + else() + find_library(${OUTPUT_LIBRARY} + NAMES ${WS_LIB_NAMES} + HINTS ${WS_LIB_HINTS} + PATHS ${WS_LIB_PATHS} + ) + endif() +endfunction() |