ENH: Disable the xmlrpc drop method by default

We've chosen to drop our default dependence on xmlrpc.  Thus we disable
the corresponding CTest submission method and remove the sources for
building xmlrpc locally.  Users can re-enable the method by setting the
CTEST_USE_XMLRPC option to use a system-installed xmlrpc library.
This commit is contained in:
Brad King 2009-06-11 11:24:56 -04:00
parent 8c5c192b9d
commit 8f5af6172a
5 changed files with 32 additions and 24 deletions

View File

@ -16,6 +16,10 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies. # Options have dependencies.
INCLUDE(CMakeDependentOption) INCLUDE(CMakeDependentOption)
# Optionally use system xmlrpc. We no longer build or use it by default.
OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
# Allow the user to enable/disable all system utility library options # Allow the user to enable/disable all system utility library options
# by setting CMAKE_USE_SYSTEM_LIBRARIES on the command line. # by setting CMAKE_USE_SYSTEM_LIBRARIES on the command line.
IF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES) IF(DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
@ -31,19 +35,15 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
CACHE BOOL "Use system-installed curl" FORCE) CACHE BOOL "Use system-installed curl" FORCE)
SET(CMAKE_USE_SYSTEM_EXPAT "${CMAKE_USE_SYSTEM_LIBRARIES}" SET(CMAKE_USE_SYSTEM_EXPAT "${CMAKE_USE_SYSTEM_LIBRARIES}"
CACHE BOOL "Use system-installed expat" FORCE) CACHE BOOL "Use system-installed expat" FORCE)
SET(CMAKE_USE_SYSTEM_XMLRPC "${CMAKE_USE_SYSTEM_LIBRARIES}"
CACHE BOOL "Use system-installed xmlrpc" FORCE)
SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}" SET(CMAKE_USE_SYSTEM_ZLIB "${CMAKE_USE_SYSTEM_LIBRARIES}"
CACHE BOOL "Use system-installed zlib" FORCE) CACHE BOOL "Use system-installed zlib" FORCE)
ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER) ENDIF(CMAKE_USE_SYSTEM_LIBRARIES_USER)
# Optionally use system utility libraries. # Optionally use system utility libraries.
OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
${CMAKE_USE_SYSTEM_LIBRARIES}) ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
OPTION(CMAKE_USE_SYSTEM_XMLRPC "Use system-installed xmlrpc"
${CMAKE_USE_SYSTEM_LIBRARIES})
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_XMLRPC" ON) ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib" CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_ZLIB "Use system-installed zlib"
${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON) ${CMAKE_USE_SYSTEM_LIBRARIES} "NOT CMAKE_USE_SYSTEM_CURL" ON)
@ -294,19 +294,15 @@ MACRO (CMAKE_BUILD_UTILITIES)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest. # Build XMLRPC library for CMake and CTest.
IF(CMAKE_USE_SYSTEM_XMLRPC) IF(CTEST_USE_XMLRPC)
FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client) FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
IF(NOT XMLRPC_FOUND) IF(NOT XMLRPC_FOUND)
MESSAGE(FATAL_ERROR MESSAGE(FATAL_ERROR
"CMAKE_USE_SYSTEM_XMLRPC is ON but a xmlrpc is not found!") "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
ENDIF(NOT XMLRPC_FOUND) ENDIF(NOT XMLRPC_FOUND)
SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_XMLRPC) ENDIF(CTEST_USE_XMLRPC)
SET(CMAKE_XMLRPC_INCLUDES)
SET(CMAKE_XMLRPC_LIBRARIES cmXMLRPC)
SUBDIRS(Utilities/cmxmlrpc)
ENDIF(CMAKE_USE_SYSTEM_XMLRPC)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Use curses? # Use curses?
@ -426,20 +422,19 @@ IF(BUILD_QtDialog)
ENDIF(BUILD_QtDialog) ENDIF(BUILD_QtDialog)
# The same might be true on other systems for other libraries if # The same might be true on other systems for other libraries.
# CMAKE_USE_SYSTEM_XMLRPC or other variables like this are enabled.
# Then only enable RPATH if we have are building at least with cmake 2.4, # Then only enable RPATH if we have are building at least with cmake 2.4,
# since this one has much better RPATH features than cmake 2.2. # since this one has much better RPATH features than cmake 2.2.
# The executables are then built with the RPATH for the libraries outside # The executables are then built with the RPATH for the libraries outside
# the build tree, which is both the build and the install RPATH. # the build tree, which is both the build and the install RPATH.
IF (UNIX) IF (UNIX)
IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.") SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CMAKE_USE_SYSTEM_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
ENDIF (UNIX) ENDIF (UNIX)

View File

@ -12,7 +12,6 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"not sorted slower link editing will result" "not sorted slower link editing will result"
"stl_deque.h:479" "stl_deque.h:479"
"Utilities.cmzlib." "Utilities.cmzlib."
"Utilities.cmxmlrpc."
"Source.CTest.Curl" "Source.CTest.Curl"
"Utilities.cmcurl" "Utilities.cmcurl"
"Source.CursesDialog.form" "Source.CursesDialog.form"

View File

@ -727,6 +727,7 @@ bool cmCTestSubmitHandler::SubmitUsingCP(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
#if defined(CTEST_USE_XMLRPC)
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix, bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
const std::set<cmStdString>& files, const std::set<cmStdString>& files,
const cmStdString& remoteprefix, const cmStdString& remoteprefix,
@ -824,6 +825,15 @@ bool cmCTestSubmitHandler::SubmitUsingXMLRPC(const cmStdString& localprefix,
xmlrpc_client_cleanup(); xmlrpc_client_cleanup();
return true; return true;
} }
#else
bool cmCTestSubmitHandler::SubmitUsingXMLRPC(cmStdString const&,
std::set<cmStdString> const&,
cmStdString const&,
cmStdString const&)
{
return false;
}
#endif
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int cmCTestSubmitHandler::ProcessHandler() int cmCTestSubmitHandler::ProcessHandler()
@ -1137,6 +1147,7 @@ int cmCTestSubmitHandler::ProcessHandler()
} }
else if ( dropMethod == "xmlrpc" ) else if ( dropMethod == "xmlrpc" )
{ {
#if defined(CTEST_USE_XMLRPC)
ofs << "Using drop method: XML-RPC" << std::endl; ofs << "Using drop method: XML-RPC" << std::endl;
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using XML-RPC submit method" cmCTestLog(this->CTest, HANDLER_OUTPUT, " Using XML-RPC submit method"
<< std::endl); << std::endl);
@ -1154,6 +1165,12 @@ int cmCTestSubmitHandler::ProcessHandler()
<< std::endl); << std::endl);
ofs << " Submission successful" << std::endl; ofs << " Submission successful" << std::endl;
return 0; return 0;
#else
cmCTestLog(this->CTest, ERROR_MESSAGE,
" Submission method \"xmlrpc\" not compiled into CTest!"
<< std::endl);
return -1;
#endif
} }
else if ( dropMethod == "scp" ) else if ( dropMethod == "scp" )
{ {

View File

@ -20,7 +20,7 @@
/* Whether CMake is using its own utility libraries. */ /* Whether CMake is using its own utility libraries. */
#cmakedefine CMAKE_USE_SYSTEM_CURL #cmakedefine CMAKE_USE_SYSTEM_CURL
#cmakedefine CMAKE_USE_SYSTEM_EXPAT #cmakedefine CMAKE_USE_SYSTEM_EXPAT
#cmakedefine CMAKE_USE_SYSTEM_XMLRPC
#cmakedefine CMAKE_USE_SYSTEM_ZLIB #cmakedefine CMAKE_USE_SYSTEM_ZLIB
#cmakedefine CTEST_USE_XMLRPC
#endif #endif

View File

@ -19,12 +19,9 @@
/* Use the xmlrpc library configured for CMake. */ /* Use the xmlrpc library configured for CMake. */
#include "cmThirdParty.h" #include "cmThirdParty.h"
#ifdef CMAKE_USE_SYSTEM_XMLRPC #ifdef CTEST_USE_XMLRPC
# include <xmlrpc.h> # include <xmlrpc.h>
# include <xmlrpc_client.h> # include <xmlrpc_client.h>
#else
# include <cmxmlrpc/xmlrpc.h>
# include <cmxmlrpc/xmlrpc_client.h>
#endif #endif
#endif #endif