Commit e7720a0f authored by Brad King's avatar Brad King
Browse files

FindXMLRPC: Tolerate no include directories

`xmlrpc-c-config $modules --cflags` may report no `-I` flags if the
headers are in a standard location like `/usr/include`.  In this case
it is okay for `XMLRPC_INCLUDE_DIRS` to be empty.

Ideally the `--cflags` output should be used as hints for a `find_path`
call to really find the headers as we do for other find modules, but
simply assuming no explicit include directories are needed is good
enough for now.

Fixes: #17347
parent b1aa8a47
......@@ -57,6 +57,7 @@ if(XMLRPC_C_FOUND)
XMLRPC_C_CONFIG_CFLAGS "${XMLRPC_C_CONFIG_CFLAGS}")
# Look for -I options.
# FIXME: Use these as hints to a find_path call to find the headers.
set(XMLRPC_INCLUDE_DIRS)
foreach(flag ${XMLRPC_C_CONFIG_CFLAGS})
if("${flag}" MATCHES "^-I(.+)")
......@@ -123,5 +124,5 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(
XMLRPC
REQUIRED_VARS XMLRPC_C_FOUND XMLRPC_LIBRARIES XMLRPC_INCLUDE_DIRS
REQUIRED_VARS XMLRPC_C_FOUND XMLRPC_LIBRARIES
FAIL_MESSAGE "XMLRPC was not found. Make sure the entries XMLRPC_* are set.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment