summaryrefslogtreecommitdiffstats
path: root/Modules/FindXMLRPC.cmake
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:47:32 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit77543bde41b0e52c3959016698b529835945d62d (patch)
treeff63e5fbec326c4a5d821e7496c6d2cb52f75b92 /Modules/FindXMLRPC.cmake
parent7bbaa4283de26864b2e55e819db0884771585467 (diff)
downloadCMake-77543bde41b0e52c3959016698b529835945d62d.zip
CMake-77543bde41b0e52c3959016698b529835945d62d.tar.gz
CMake-77543bde41b0e52c3959016698b529835945d62d.tar.bz2
Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Modules/FindXMLRPC.cmake')
-rw-r--r--Modules/FindXMLRPC.cmake142
1 files changed, 71 insertions, 71 deletions
diff --git a/Modules/FindXMLRPC.cmake b/Modules/FindXMLRPC.cmake
index eccfb48..0fae1d71 100644
--- a/Modules/FindXMLRPC.cmake
+++ b/Modules/FindXMLRPC.cmake
@@ -10,7 +10,7 @@
# cgi-server CGI-based server
# abyss-server ABYSS-based server
# Typical usage:
-# FIND_PACKAGE(XMLRPC REQUIRED libwww-client)
+# find_package(XMLRPC REQUIRED libwww-client)
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -26,121 +26,121 @@
# License text for the above reference.)
# First find the config script from which to obtain other values.
-FIND_PROGRAM(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
+find_program(XMLRPC_C_CONFIG NAMES xmlrpc-c-config)
# Check whether we found anything.
-IF(XMLRPC_C_CONFIG)
- SET(XMLRPC_FOUND 1)
-ELSE(XMLRPC_C_CONFIG)
- SET(XMLRPC_FOUND 0)
-ENDIF(XMLRPC_C_CONFIG)
+if(XMLRPC_C_CONFIG)
+ set(XMLRPC_FOUND 1)
+else(XMLRPC_C_CONFIG)
+ set(XMLRPC_FOUND 0)
+endif(XMLRPC_C_CONFIG)
# Lookup the include directories needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
# Use the newer EXECUTE_PROCESS command if it is available.
- IF(COMMAND EXECUTE_PROCESS)
- EXECUTE_PROCESS(
+ if(COMMAND EXECUTE_PROCESS)
+ execute_process(
COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --cflags
OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
)
- ELSE(COMMAND EXECUTE_PROCESS)
- EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
+ else(COMMAND EXECUTE_PROCESS)
+ exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --cflags"
OUTPUT_VARIABLE XMLRPC_C_CONFIG_CFLAGS
RETURN_VALUE XMLRPC_C_CONFIG_RESULT
)
- ENDIF(COMMAND EXECUTE_PROCESS)
+ endif(COMMAND EXECUTE_PROCESS)
# Parse the include flags.
- IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
# Convert the compile flags to a CMake list.
- STRING(REGEX REPLACE " +" ";"
+ string(REGEX REPLACE " +" ";"
XMLRPC_C_CONFIG_CFLAGS "${XMLRPC_C_CONFIG_CFLAGS}")
# Look for -I options.
- SET(XMLRPC_INCLUDE_DIRS)
- FOREACH(flag ${XMLRPC_C_CONFIG_CFLAGS})
- IF("${flag}" MATCHES "^-I")
- STRING(REGEX REPLACE "^-I" "" DIR "${flag}")
- FILE(TO_CMAKE_PATH "${DIR}" DIR)
- SET(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
- ENDIF("${flag}" MATCHES "^-I")
- ENDFOREACH(flag)
- ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
- SET(XMLRPC_FOUND 0)
- ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+ set(XMLRPC_INCLUDE_DIRS)
+ foreach(flag ${XMLRPC_C_CONFIG_CFLAGS})
+ if("${flag}" MATCHES "^-I")
+ string(REGEX REPLACE "^-I" "" DIR "${flag}")
+ file(TO_CMAKE_PATH "${DIR}" DIR)
+ set(XMLRPC_INCLUDE_DIRS ${XMLRPC_INCLUDE_DIRS} "${DIR}")
+ endif("${flag}" MATCHES "^-I")
+ endforeach(flag)
+ else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+ set(XMLRPC_FOUND 0)
+ endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+endif(XMLRPC_FOUND)
# Lookup the libraries needed for the components requested.
-IF(XMLRPC_FOUND)
+if(XMLRPC_FOUND)
# Use the newer EXECUTE_PROCESS command if it is available.
- IF(COMMAND EXECUTE_PROCESS)
- EXECUTE_PROCESS(
+ if(COMMAND EXECUTE_PROCESS)
+ execute_process(
COMMAND ${XMLRPC_C_CONFIG} ${XMLRPC_FIND_COMPONENTS} --libs
OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
OUTPUT_STRIP_TRAILING_WHITESPACE
RESULT_VARIABLE XMLRPC_C_CONFIG_RESULT
)
- ELSE(COMMAND EXECUTE_PROCESS)
- EXEC_PROGRAM(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
+ else(COMMAND EXECUTE_PROCESS)
+ exec_program(${XMLRPC_C_CONFIG} ARGS "${XMLRPC_FIND_COMPONENTS} --libs"
OUTPUT_VARIABLE XMLRPC_C_CONFIG_LIBS
RETURN_VALUE XMLRPC_C_CONFIG_RESULT
)
- ENDIF(COMMAND EXECUTE_PROCESS)
+ endif(COMMAND EXECUTE_PROCESS)
# Parse the library names and directories.
- IF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- STRING(REGEX REPLACE " +" ";"
+ if("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ string(REGEX REPLACE " +" ";"
XMLRPC_C_CONFIG_LIBS "${XMLRPC_C_CONFIG_LIBS}")
# Look for -L flags for directories and -l flags for library names.
- SET(XMLRPC_LIBRARY_DIRS)
- SET(XMLRPC_LIBRARY_NAMES)
- FOREACH(flag ${XMLRPC_C_CONFIG_LIBS})
- IF("${flag}" MATCHES "^-L")
- STRING(REGEX REPLACE "^-L" "" DIR "${flag}")
- FILE(TO_CMAKE_PATH "${DIR}" DIR)
- SET(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
- ELSEIF("${flag}" MATCHES "^-l")
- STRING(REGEX REPLACE "^-l" "" NAME "${flag}")
- SET(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
- ENDIF("${flag}" MATCHES "^-L")
- ENDFOREACH(flag)
+ set(XMLRPC_LIBRARY_DIRS)
+ set(XMLRPC_LIBRARY_NAMES)
+ foreach(flag ${XMLRPC_C_CONFIG_LIBS})
+ if("${flag}" MATCHES "^-L")
+ string(REGEX REPLACE "^-L" "" DIR "${flag}")
+ file(TO_CMAKE_PATH "${DIR}" DIR)
+ set(XMLRPC_LIBRARY_DIRS ${XMLRPC_LIBRARY_DIRS} "${DIR}")
+ elseif("${flag}" MATCHES "^-l")
+ string(REGEX REPLACE "^-l" "" NAME "${flag}")
+ set(XMLRPC_LIBRARY_NAMES ${XMLRPC_LIBRARY_NAMES} "${NAME}")
+ endif("${flag}" MATCHES "^-L")
+ endforeach(flag)
# Search for each library needed using the directories given.
- FOREACH(name ${XMLRPC_LIBRARY_NAMES})
+ foreach(name ${XMLRPC_LIBRARY_NAMES})
# Look for this library.
- FIND_LIBRARY(XMLRPC_${name}_LIBRARY
+ find_library(XMLRPC_${name}_LIBRARY
NAMES ${name}
HINTS ${XMLRPC_LIBRARY_DIRS}
)
- MARK_AS_ADVANCED(XMLRPC_${name}_LIBRARY)
+ mark_as_advanced(XMLRPC_${name}_LIBRARY)
# If any library is not found then the whole package is not found.
- IF(NOT XMLRPC_${name}_LIBRARY)
- SET(XMLRPC_FOUND 0)
- ENDIF(NOT XMLRPC_${name}_LIBRARY)
+ if(NOT XMLRPC_${name}_LIBRARY)
+ set(XMLRPC_FOUND 0)
+ endif(NOT XMLRPC_${name}_LIBRARY)
# Build an ordered list of all the libraries needed.
- SET(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
- ENDFOREACH(name)
- ELSE("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
- MESSAGE("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
- SET(XMLRPC_FOUND 0)
- ENDIF("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
-ENDIF(XMLRPC_FOUND)
+ set(XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES} "${XMLRPC_${name}_LIBRARY}")
+ endforeach(name)
+ else("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+ message("Error running ${XMLRPC_C_CONFIG}: [${XMLRPC_C_CONFIG_RESULT}]")
+ set(XMLRPC_FOUND 0)
+ endif("${XMLRPC_C_CONFIG_RESULT}" MATCHES "^0$")
+endif(XMLRPC_FOUND)
# Report the results.
-IF(NOT XMLRPC_FOUND)
- SET(XMLRPC_DIR_MESSAGE
+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(NOT XMLRPC_FIND_QUIETLY)
- IF(XMLRPC_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
- ENDIF(XMLRPC_FIND_REQUIRED)
- ENDIF(NOT XMLRPC_FIND_QUIETLY)
-ENDIF(NOT XMLRPC_FOUND)
+ if(NOT XMLRPC_FIND_QUIETLY)
+ message(STATUS "${XMLRPC_DIR_MESSAGE}")
+ else(NOT XMLRPC_FIND_QUIETLY)
+ if(XMLRPC_FIND_REQUIRED)
+ message(FATAL_ERROR "${XMLRPC_DIR_MESSAGE}")
+ endif(XMLRPC_FIND_REQUIRED)
+ endif(NOT XMLRPC_FIND_QUIETLY)
+endif(NOT XMLRPC_FOUND)