FindCUDA: Avoid if() auto-dereference in string comparisons

This silences possible CMP0054 warnings.
This commit is contained in:
Adam Strzelecki 2014-09-17 13:54:29 +02:00 committed by Brad King
parent 17a457dcb0
commit 84e3fde94d
2 changed files with 8 additions and 8 deletions

View File

@ -894,15 +894,15 @@ macro(CUDA_GET_SOURCES_AND_OPTIONS _sources _cmake_options _options)
set( ${_options} ) set( ${_options} )
set( _found_options FALSE ) set( _found_options FALSE )
foreach(arg ${ARGN}) foreach(arg ${ARGN})
if(arg STREQUAL "OPTIONS") if("x${arg}" STREQUAL "xOPTIONS")
set( _found_options TRUE ) set( _found_options TRUE )
elseif( elseif(
arg STREQUAL "WIN32" OR "x${arg}" STREQUAL "xWIN32" OR
arg STREQUAL "MACOSX_BUNDLE" OR "x${arg}" STREQUAL "xMACOSX_BUNDLE" OR
arg STREQUAL "EXCLUDE_FROM_ALL" OR "x${arg}" STREQUAL "xEXCLUDE_FROM_ALL" OR
arg STREQUAL "STATIC" OR "x${arg}" STREQUAL "xSTATIC" OR
arg STREQUAL "SHARED" OR "x${arg}" STREQUAL "xSHARED" OR
arg STREQUAL "MODULE" "x${arg}" STREQUAL "xMODULE"
) )
list(APPEND ${_cmake_options} ${arg}) list(APPEND ${_cmake_options} ${arg})
else() else()

View File

@ -126,7 +126,7 @@ endif()
# and other return variables are present after executing the process. # and other return variables are present after executing the process.
macro(cuda_execute_process status command) macro(cuda_execute_process status command)
set(_command ${command}) set(_command ${command})
if(NOT _command STREQUAL "COMMAND") if(NOT "x${_command}" STREQUAL "xCOMMAND")
message(FATAL_ERROR "Malformed call to cuda_execute_process. Missing COMMAND as second argument. (command = ${command})") message(FATAL_ERROR "Malformed call to cuda_execute_process. Missing COMMAND as second argument. (command = ${command})")
endif() endif()
if(verbose) if(verbose)