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})'.
This commit is contained in:
parent
cede5cbd53
commit
425acc522f
|
@ -13,7 +13,7 @@
|
||||||
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
# CMAKE_REQUIRED_LIBRARIES = list of libraries to link
|
||||||
|
|
||||||
MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
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}")
|
SET(message "${VAR}")
|
||||||
# If the number of arguments is greater than 2 (SOURCE VAR)
|
# If the number of arguments is greater than 2 (SOURCE VAR)
|
||||||
IF(${ARGC} GREATER 2)
|
IF(${ARGC} GREATER 2)
|
||||||
|
@ -70,5 +70,5 @@ MACRO(CURL_CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Source file was:\n${src}\n")
|
"Source file was:\n${src}\n")
|
||||||
ENDIF(${VAR})
|
ENDIF(${VAR})
|
||||||
ENDIF("${VAR}" MATCHES "^${VAR}$" OR "${VAR}" MATCHES "UNKNOWN")
|
ENDIF()
|
||||||
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
|
ENDMACRO(CURL_CHECK_C_SOURCE_COMPILES)
|
||||||
|
|
|
@ -505,7 +505,7 @@ ENDIF(NOT HAVE_SIGSETJMP)
|
||||||
|
|
||||||
# For other curl specific tests, use this macro.
|
# For other curl specific tests, use this macro.
|
||||||
MACRO(CURL_INTERNAL_TEST CURL_TEST)
|
MACRO(CURL_INTERNAL_TEST CURL_TEST)
|
||||||
IF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
IF(NOT DEFINED ${CURL_TEST})
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
"-D${CURL_TEST} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
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"
|
"Performing Curl Test ${CURL_TEST} failed with the following output:\n"
|
||||||
"${OUTPUT}\n")
|
"${OUTPUT}\n")
|
||||||
ENDIF(${CURL_TEST})
|
ENDIF(${CURL_TEST})
|
||||||
ENDIF("${CURL_TEST}" MATCHES "^${CURL_TEST}$")
|
ENDIF()
|
||||||
ENDMACRO(CURL_INTERNAL_TEST)
|
ENDMACRO(CURL_INTERNAL_TEST)
|
||||||
|
|
||||||
# Do curl specific tests
|
# Do curl specific tests
|
||||||
|
|
Loading…
Reference in New Issue