# Locate an optional MsQuic installation without pulling in a second TLS runtime. # # The project supports either: # -DCMVR_MSQUIC_ROOT=/path/to/msquic/prefix # or a package placed below: # dependency//third_party/msquic// # # Result: # MsQuic_FOUND # MsQuic::msquic include_guard(GLOBAL) set(CMVR_MSQUIC_ROOT "" CACHE PATH "MsQuic installation prefix") set(_cmvr_msquic_hints) if(CMVR_MSQUIC_ROOT) list(APPEND _cmvr_msquic_hints "${CMVR_MSQUIC_ROOT}") endif() if(DEFINED PROJECT_SOURCE_DIR AND DEFINED ARCH) file(GLOB _cmvr_msquic_bundled_roots LIST_DIRECTORIES true "${PROJECT_SOURCE_DIR}/dependency/${ARCH}/third_party/msquic/*") list(APPEND _cmvr_msquic_hints "${PROJECT_SOURCE_DIR}/dependency/${ARCH}/third_party/msquic" ${_cmvr_msquic_bundled_roots}) endif() find_path(MsQuic_INCLUDE_DIR NAMES msquic.h HINTS ${_cmvr_msquic_hints} PATH_SUFFIXES include) find_library(MsQuic_LIBRARY NAMES msquic libmsquic HINTS ${_cmvr_msquic_hints} PATH_SUFFIXES lib lib64 bin) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(MsQuic REQUIRED_VARS MsQuic_INCLUDE_DIR MsQuic_LIBRARY) if(MsQuic_FOUND AND NOT TARGET MsQuic::msquic) add_library(MsQuic::msquic UNKNOWN IMPORTED) set_target_properties(MsQuic::msquic PROPERTIES IMPORTED_LOCATION "${MsQuic_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${MsQuic_INCLUDE_DIR}") endif() mark_as_advanced(MsQuic_INCLUDE_DIR MsQuic_LIBRARY)