diff options
author | Brad King <brad.king@kitware.com> | 2017-05-26 15:14:57 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-05-26 15:15:49 (GMT) |
commit | 6f74bbaffec687dce755ee985b3bf69e915d3a8d (patch) | |
tree | 073d318dad8d9eebc7da909667771e8877465018 | |
parent | 5b8ac116c398366947348e3d4772a19d9acdf01d (diff) | |
parent | eb0cfd2847b234dbb1b0bd42587201d83f04513b (diff) | |
download | CMake-6f74bbaffec687dce755ee985b3bf69e915d3a8d.zip CMake-6f74bbaffec687dce755ee985b3bf69e915d3a8d.tar.gz CMake-6f74bbaffec687dce755ee985b3bf69e915d3a8d.tar.bz2 |
Merge topic 'findxmlrpc_fix'
eb0cfd28 FindXMLRPC: handle QUIETLY and REQUIRED correctly
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !887
-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.") |