mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-04 12:49:36 -06:00
FindXMLRPC: handle QUIETLY and REQUIRED correctly
Use the built in FindPackageHandleStandardArgs. Fixes: #16912 Signed-off-by: Niklas Simons <nsimons@abo.fi>
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user