ExternalProject: Avoid if() auto-dereference of a "TEST" variable

Exposed by CMP0054 warnings.
This commit is contained in:
Matt McCormick 2015-07-29 14:46:40 -04:00 committed by Brad King
parent 22b8f23849
commit 623dcc85a4

View File

@ -1211,7 +1211,7 @@ function(_ep_get_build_command name step cmd_var)
if(step STREQUAL "INSTALL") if(step STREQUAL "INSTALL")
set(args install) set(args install)
endif() endif()
if(step STREQUAL "TEST") if("x${step}x" STREQUAL "xTESTx")
set(args test) set(args test)
endif() endif()
else() else()
@ -1230,7 +1230,7 @@ function(_ep_get_build_command name step cmd_var)
list(APPEND args --target install) list(APPEND args --target install)
endif() endif()
# But for "TEST" drive the project with corresponding "ctest". # But for "TEST" drive the project with corresponding "ctest".
if(step STREQUAL "TEST") if("x${step}x" STREQUAL "xTESTx")
string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}") string(REGEX REPLACE "^(.*/)cmake([^/]*)$" "\\1ctest\\2" cmd "${cmd}")
set(args "") set(args "")
endif() endif()
@ -1246,7 +1246,7 @@ function(_ep_get_build_command name step cmd_var)
if(step STREQUAL "INSTALL") if(step STREQUAL "INSTALL")
set(args install) set(args install)
endif() endif()
if(step STREQUAL "TEST") if("x${step}x" STREQUAL "xTESTx")
set(args test) set(args test)
endif() endif()
endif() endif()