find_package(XMLRPC REQUIRED) does not fail if xmlrpc is not available
Hi,
I think the logic at the end of FindXMLRPC.cmake
is flawed. It says:
# 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()
This means that just writing find_package(XMLRPC REQUIRED)
will not lead to a FATAL_ERROR
. To actually achieve the fatal error one has to add a QUIET
to the find_package
call. But that doesn't make much sense. Instead, the warning should be printed by default, should be hidden whe QUIET
is passed and be an error if REQUIRED
is passed. But that's not the current behaviour. Maybe the following would be better:
# Report the results.
if(NOT XMLRPC_FOUND AND NOT XMLRPC_FIND_QUIETLY)
set(XMLRPC_DIR_MESSAGE
"XMLRPC was not found. Make sure the entries XMLRPC_* are set.")
if(XMLRPC_FIND_REQUIRED)
message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
else()
message(STATUS "${XMLRPC_DIR_MESSAGE}")
endif()
endif()
Thanks!
cheers, josch