2011-12-07 15 views
1

我正在使用cmake如果條件裏面的宏/函數

它總是在裏面的其他功能爲什麼?

function(add_exe_name exe STAND2) 
if(STAND2 EQUAL FALSE) 
MESSAGE (FATAL_ERROR "Are bhi ${STAND} ${STAND2}") 
SET(${exe}-exe "app-${exe}") 
SET(${exe}-temp "app-${exe}") 
else() 
MESSAGE (FATAL_ERROR "${STAND} ${STAND2}") 
SET(${exe}-exe "app-${exe}") 
SET(${exe}-temp "${exe}") 
endif(STAND2 EQUAL FALSE) 
endfunction(add_exe_name) 

它不取約臺上2

回答

3

的價值護理取代if(STAND2 EQUAL FALSE)if(NOT STAND2)

1

這些都是約如果命令就等於官方的解釋,既要有handside應該有效數字,這就是爲什麼你的,如果分支永遠不會被評估的原因。

 if(<variable|string> LESS <variable|string>)
if(<variable|string> GREATER <variable|string>)
if(<variable|string> EQUAL <variable|string>)
True if the given string or variable's value is a valid number and the inequality or equality is true.