1 # FIND_PACKAGE_MESSAGE(<name> "message for user" "find result details")
3 # This macro is intended to be used in FindXXX.cmake modules files.
4 # It will print a message once for each unique find result.
5 # This is useful for telling the user where a package was found.
6 # The first argument specifies the name (XXX) of the package.
7 # The second argument specifies the message to display.
8 # The third argument lists details about the find result so that
9 # if they change the message will be displayed again.
10 # The macro also obeys the QUIET argument to the find_package command.
15 # FIND_PACKAGE_MESSAGE(X11 "Found X11: ${X11_X11_LIB}"
16 # "[${X11_X11_LIB}][${X11_INCLUDE_DIR}]")
21 FUNCTION(FIND_PACKAGE_MESSAGE pkg msg details)
22 # Avoid printing a message repeatedly for the same find result.
23 IF(NOT ${pkg}_FIND_QUIETLY)
24 SET(DETAILS_VAR FIND_PACKAGE_MESSAGE_DETAILS_${pkg})
25 IF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
26 # The message has not yet been printed.
27 MESSAGE(STATUS "${msg}")
29 # Save the find details in the cache to avoid printing the same
31 SET("${DETAILS_VAR}" "${details}"
32 CACHE INTERNAL "Details about finding ${pkg}")
33 ENDIF(NOT "${details}" STREQUAL "${${DETAILS_VAR}}")
34 ENDIF(NOT ${pkg}_FIND_QUIETLY)
35 ENDFUNCTION(FIND_PACKAGE_MESSAGE)