diff options
author | Niklas Simons <nsimons@abo.fi> | 2017-05-24 18:36:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-05-25 19:26:05 (GMT) |
commit | eb0cfd2847b234dbb1b0bd42587201d83f04513b (patch) | |
tree | bd72088e1c9d9771a52b95fbc4f1db41eeb99563 /Modules/FindXMLRPC.cmake | |
parent | 43d9b296f5688b865bc2c40ea0af3b042047dfe8 (diff) | |
download | CMake-eb0cfd2847b234dbb1b0bd42587201d83f04513b.zip CMake-eb0cfd2847b234dbb1b0bd42587201d83f04513b.tar.gz CMake-eb0cfd2847b234dbb1b0bd42587201d83f04513b.tar.bz2 |
FindXMLRPC: handle QUIETLY and REQUIRED correctly
Use the built in FindPackageHandleStandardArgs.
Fixes: #16912
Signed-off-by: Niklas Simons <nsimons@abo.fi>
Diffstat (limited to 'Modules/FindXMLRPC.cmake')
-rw-r--r-- | Modules/FindXMLRPC.cmake | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake index dd9dffc..f0b2583 100644 --- a/Modules/FindXMLRPC.cmake +++ b/Modules/FindXMLRPC.cmake @@ -36,13 +36,13 @@ find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config) # Check whether we found anything. if(XMLRPC_C_CONFIG) - set(XMLRPC_FOUND 1) + set(XMLRPC_C_FOUND 1) else() - set(XMLRPC_FOUND 0) + set(XMLRPC_C_FOUND 0) endif() # Lookup the include directories needed for the components requested. -if(XMLRPC_FOUND) +if(XMLRPC_C_FOUND) # Use the newer EXECUTE_PROCESS command if it is available. if(COMMAND EXECUTE_PROCESS) execute_process( @@ -74,12 +74,12 @@ if(XMLRPC_FOUND) endforeach() else() message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]") - set(XMLRPC_FOUND 0) + set(XMLRPC_C_FOUND 0) endif() endif() # Lookup the libraries needed for the components requested. -if(XMLRPC_FOUND) +if(XMLRPC_C_FOUND) # Use the newer EXECUTE_PROCESS command if it is available. if(COMMAND EXECUTE_PROCESS) execute_process( @@ -123,7 +123,7 @@ if(XMLRPC_FOUND) # If any library is not found then the whole package is not found. if(NOT XMLRPC_${name}_LIBRARY) - set(XMLRPC_FOUND 0) + set(XMLRPC_C_FOUND 0) endif() # Build an ordered list of all the libraries needed. @@ -131,19 +131,13 @@ if(XMLRPC_FOUND) endforeach() else() message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]") - set(XMLRPC_FOUND 0) + set(XMLRPC_C_FOUND 0) endif() endif() # Report the results. -if(NOT XMLRPC_FOUND) - set(XMLRPC_DIR_MESSAGE - "XMLRPC was not found. Make sure the entries XMLRPC_* are set.") - if(NOT XMLRPC_FIND_QUIETLY) - message(STATUS "${XMLRPC_DIR_MESSAGE}") - else() - if(XMLRPC_FIND_REQUIRED) - message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}") - endif() - endif() -endif() +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS( + XMLRPC + REQUIRED_VARS XMLRPC_C_FOUND XMLRPC_LIBRARIES XMLRPC_INCLUDE_DIRS + FAIL_MESSAGE "XMLRPC was not found. Make sure the entries XMLRPC_* are set.") |