summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-09-08 10:02:55 -0400
committerNils Gladitz <nilsgladitz@gmail.com>2014-09-11 21:23:24 +0200
commit425acc522ff27014ffcc1d1f902f3702dd6c7aa7 (patch)
treec33548bb6fbaf58c1f2b8004e87021d2d3c8346d /Utilities/cmcurl
parentcede5cbd53175be721ee2786cf0e482be3134fcf (diff)
downloadcmake-425acc522ff27014ffcc1d1f902f3702dd6c7aa7.tar.gz
cmcurl: Use if(DEFINED) to simplify conditions
Replace old hacks of the form 'if("${VAR}" MATCHES "^${VAR}$")' with the much simpler 'if(NOT DEFINED ${VAR})'.
Diffstat (limited to 'Utilities/cmcurl')
-rw-r--r--Utilities/cmcurl/CMake/CurlCheckCSourceCompiles.cmake4
-rw-r--r--Utilities/cmcurl/CMakeLists.txt4
2 files changed, 4 insertions, 4 deletions
diff --git a/Utilities/cmcurl/CMake/CurlCheckCSourceCompiles.cmake b/Utilities/cmcurl/CMake/CurlCheckCSourceCompiles.cmake
index cfcf47bd6c..2f427a2a7d 100644
--- a/Utilities/cmcurl/CMake/CurlCheckCSourceCompiles.cmake
+++ b/Utilities/cmcurl/CMake/CurlCheckCSourceCompiles.cmake
@@ -13,7 +13,7 @@
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
- IF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
+ IF(NOT DEFINED ${VAR} OR ${VAR} MATCHES "UNKNOWN")
SET(message "${VAR}")
# If the number of arguments is greater than 2 (SOURCE VAR)
IF(${ARGC} GREATER 2)
@@ -70,5 +70,5 @@ MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
"${OUTPUT}\n"
"Source file was:\n${src}\n")
ENDIF(${VAR})
- ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
+ ENDIF()
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
diff --git a/Utilities/cmcurl/CMakeLists.txt b/Utilities/cmcurl/CMakeLists.txt
index 1b918c90af..03f10a0c93 100644
--- a/Utilities/cmcurl/CMakeLists.txt
+++ b/Utilities/cmcurl/CMakeLists.txt
@@ -505,7 +505,7 @@ ENDIF(NOT HAVE_SIGSETJMP)
# 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} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
@@ -533,7 +533,7 @@ 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)
# Do curl specific tests