diff options
author | Brad King <brad.king@kitware.com> | 2014-10-29 23:34:35 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-10-30 15:11:49 (GMT) |
commit | 59242702739b92f1a152e2a2bb32772638fdf5be (patch) | |
tree | 4a2ff78a870f52bb9dd9d098323e67915893d049 /Utilities/cmcurl/CMake/Macros.cmake | |
parent | 8d311a813c8807a518631ae63cff55c537d3eb7e (diff) | |
download | CMake-59242702739b92f1a152e2a2bb32772638fdf5be.zip CMake-59242702739b92f1a152e2a2bb32772638fdf5be.tar.gz CMake-59242702739b92f1a152e2a2bb32772638fdf5be.tar.bz2 |
curl: Simplify if() conditions on check result variables
Remove use of an old hack that takes advantage of the auto-dereference
behavior of the if() command to detect if a variable is defined. The
hack has the form:
if("${VAR} MATCHES "^${VAR}$")
where "${VAR}" is a macro argument reference. Use if(DEFINED) instead.
This also avoids warnings for CMake Policy CMP0054.
Diffstat (limited to 'Utilities/cmcurl/CMake/Macros.cmake')
-rw-r--r-- | Utilities/cmcurl/CMake/Macros.cmake | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/cmcurl/CMake/Macros.cmake b/Utilities/cmcurl/CMake/Macros.cmake index 80a8833..c770a55 100644 --- a/Utilities/cmcurl/CMake/Macros.cmake +++ b/Utilities/cmcurl/CMake/Macros.cmake @@ -21,7 +21,7 @@ endmacro(CHECK_INCLUDE_FILE_CONCAT) # For other curl specific tests, use this macro. macro(CURL_INTERNAL_TEST CURL_TEST) - if("${CURL_TEST}" MATCHES "^${CURL_TEST}$") + if(NOT DEFINED "${CURL_TEST}") set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${CURL_TEST} ${CURL_TEST_DEFINES} ${CMAKE_REQUIRED_FLAGS}") if(CMAKE_REQUIRED_LIBRARIES) @@ -49,11 +49,11 @@ macro(CURL_INTERNAL_TEST CURL_TEST) "Performing Curl Test ${CURL_TEST} failed with the following output:\n" "${OUTPUT}\n") endif(${CURL_TEST}) - endif("${CURL_TEST}" MATCHES "^${CURL_TEST}$") + endif() endmacro(CURL_INTERNAL_TEST) macro(CURL_INTERNAL_TEST_RUN CURL_TEST) - if("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$") + if(NOT DEFINED "${CURL_TEST}_COMPILE") set(MACRO_CHECK_FUNCTION_DEFINITIONS "-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}") if(CMAKE_REQUIRED_LIBRARIES) @@ -85,5 +85,5 @@ macro(CURL_INTERNAL_TEST_RUN CURL_TEST) file(APPEND "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log" "\n\n") endif(${CURL_TEST}_COMPILE AND NOT ${CURL_TEST}) - endif("${CURL_TEST}_COMPILE" MATCHES "^${CURL_TEST}_COMPILE$") + endif() endmacro(CURL_INTERNAL_TEST_RUN) |