include_guard(GLOBAL) include(deps_install) set(PRINT_DEPS_INFO ON CACHE BOOL "Print deps info.") # 默认设定为 ON set(_print ${PRINT_DEPS_INFO}) set(DEPS_FOUND TRUE) if (WIN32 AND NOT CYGWIN) # cygwin 不依赖 dl find_package(dlfcn-win32 QUIET) if (NOT dlfcn-win32_FOUND) set(DEPS_FOUND FALSE) message(WARNING "dlfcn-win32 not found. But you can try install it by the cmake program.") else() set(dlfcn_lib dlfcn-win32::dl) wi_install_import(TARGETS dlfcn-win32::dl) endif() else() set(DLFCN_AUTO_FIND FALSE CACHE BOOL "dlfcn auto find by compiler.") set(DLFCN_ROOT "" CACHE STRING "The directory of dl.") set(dlfcn_root ${DLFCN_ROOT}) if (dlfcn_root) find_library(dlfcn_path dl HINTS ${dlfcn_root}) else() find_library(dlfcn_path dl) endif() if (NOT dlfcn_path) if (DLFCN_AUTO_FIND) set(dlfcn_path "") else() set(DEPS_FOUND FALSE) message(SEND_ERROR "dlfcn not found.") endif() endif() unset(dlfcn_root) set(dlfcn_lib ${dlfcn_path}) endif() find_package(PCRE2 COMPONENTS 8BIT QUIET) if (NOT PCRE2_FOUND) set(DEPS_FOUND FALSE) message(WARNING "PCRE2 8BIT not found. But you can try install it by the cmake program.") else() wi_install_import(TARGETS PCRE2::8BIT) endif() find_package(Threads QUIET) if (NOT Threads_FOUND) set(DEPS_FOUND FALSE) message(SEND_ERROR "Threads library not found.") else() wi_install_import(TARGETS Threads::Threads) endif()