message(AUTHOR_WARNING"Plural form ${tmp} found in config options of ${PREFIX}. This works as before but is now deprecated. Please only use singular forms INCLUDE_DIR and LIBRARY, and update your find scripts for LibFindMacros > 2.0 automatic dependency system (most often you can simply remove the PROCESS variables entirely).")
endif()
# Include/library names separated by spaces (notice: not CMake lists)
unset(includes)
unset(libs)
# Process all includes and set found false if any are missing
foreach(i${includeopts})
list(APPENDconfigopts${i})
if(NOT"${${i}}"STREQUAL"${i}-NOTFOUND")
list(APPENDincludes"${${i}}")
else()
set(foundFALSE)
set(missing_headersTRUE)
endif()
endforeach()
# Process all libraries and set found false if any are missing
foreach(i${libraryopts})
list(APPENDconfigopts${i})
if(NOT"${${i}}"STREQUAL"${i}-NOTFOUND")
list(APPENDlibs"${${i}}")
else()
set(foundFALSE)
endif()
endforeach()
# Version checks
if(foundANDfindver)
if(NOTversion)
message(WARNING"The find module for ${PREFIX} does not provide version information, so we'll just assume that it is OK. Please fix the module or remove package version requirements to get rid of this warning.")
set(vars"${vars}You may use CMake GUI, cmake -D or ccmake to modify the values. Delete CMakeCache.txt to discard all values and force full re-detection if necessary.\n")
if(version_unsuitable)
set(msg"${PREFIX} ${${PREFIX}_VERSION} was found but")
if(exactver)
set(msg"${msg} only version ${findver} is acceptable.")
else()
set(msg"${msg} version ${findver} is the minimum requirement.")
endif()
else()
if(missing_headers)
set(msg"We could not find development headers for ${PREFIX}. Do you have the necessary dev package installed?")
elseif(some_files)
set(msg"We only found some files of ${PREFIX}, not all of them. Perhaps your installation is incomplete or maybe we just didn't look in the right place?")
if(findver)
set(msg"${msg} This could also be caused by incompatible version (if it helps, at least ${PREFIX} ${findver} should work).")
endif()
else()
set(msg"We were unable to find package ${PREFIX}.")
endif()
endif()
# Fatal error out if REQUIRED
if(required)
set(msg"REQUIRED PACKAGE NOT FOUND\n${msg} This package is REQUIRED and you need to install it or adjust CMake configuration in order to continue building ${CMAKE_PROJECT_NAME}.")
message(FATAL_ERROR"${msg}\n${vars}")
endif()
# Otherwise just print a nasty warning
if(NOTquiet)
message(WARNING"WARNING: MISSING PACKAGE\n${msg} This package is NOT REQUIRED and you may ignore this warning but by doing so you may miss some functionality of ${CMAKE_PROJECT_NAME}. \n${vars}")