Commit 80e852f6 authored by Brad King's avatar Brad King
Browse files

kwsysPlatformTests: Use if(DEFINED) to simplify conditions

Replace old hacks of the form 'if("${VAR}" MATCHES "^${VAR}$")'
with the much simpler 'if(NOT DEFINED ${VAR})'.

Change-Id: Ie0e2fc5ceb85156221abe8938dfdd148b3862742
parent 93eb1a1f
...@@ -13,7 +13,7 @@ SET(KWSYS_PLATFORM_TEST_FILE_C kwsysPlatformTestsC.c) ...@@ -13,7 +13,7 @@ SET(KWSYS_PLATFORM_TEST_FILE_C kwsysPlatformTestsC.c)
SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx) SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx)
MACRO(KWSYS_PLATFORM_TEST lang var description invert) MACRO(KWSYS_PLATFORM_TEST lang var description invert)
IF("${var}_COMPILED" MATCHES "^${var}_COMPILED$") IF(NOT DEFINED ${var}_COMPILED)
MESSAGE(STATUS "${description}") MESSAGE(STATUS "${description}")
TRY_COMPILE(${var}_COMPILED TRY_COMPILE(${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -43,7 +43,7 @@ MACRO(KWSYS_PLATFORM_TEST lang var description invert) ...@@ -43,7 +43,7 @@ MACRO(KWSYS_PLATFORM_TEST lang var description invert)
MESSAGE(STATUS "${description} - no") MESSAGE(STATUS "${description} - no")
ENDIF(${var}_COMPILED) ENDIF(${var}_COMPILED)
ENDIF(${invert} MATCHES INVERT) ENDIF(${invert} MATCHES INVERT)
ENDIF("${var}_COMPILED" MATCHES "^${var}_COMPILED$") ENDIF()
IF(${invert} MATCHES INVERT) IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED) IF(${var}_COMPILED)
SET(${var} 0) SET(${var} 0)
...@@ -60,7 +60,7 @@ MACRO(KWSYS_PLATFORM_TEST lang var description invert) ...@@ -60,7 +60,7 @@ MACRO(KWSYS_PLATFORM_TEST lang var description invert)
ENDMACRO(KWSYS_PLATFORM_TEST) ENDMACRO(KWSYS_PLATFORM_TEST)
MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert) MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert)
IF("${var}" MATCHES "^${var}$") IF(NOT DEFINED ${var})
MESSAGE(STATUS "${description}") MESSAGE(STATUS "${description}")
TRY_RUN(${var} ${var}_COMPILED TRY_RUN(${var} ${var}_COMPILED
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
...@@ -107,7 +107,7 @@ MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert) ...@@ -107,7 +107,7 @@ MACRO(KWSYS_PLATFORM_TEST_RUN lang var description invert)
MESSAGE(STATUS "${description} - failed to compile") MESSAGE(STATUS "${description} - failed to compile")
ENDIF(${var}_COMPILED) ENDIF(${var}_COMPILED)
ENDIF(${invert} MATCHES INVERT) ENDIF(${invert} MATCHES INVERT)
ENDIF("${var}" MATCHES "^${var}$") ENDIF()
IF(${invert} MATCHES INVERT) IF(${invert} MATCHES INVERT)
IF(${var}_COMPILED) IF(${var}_COMPILED)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment