2017-03-07 183 views
0

我在.cmake文件if声明,读起来像:错误cmake的IF语句

if((NOT ${GCC_VERSION} GREATER some_version) AND something EQUAL somethingelse) 
    #todo ... 
endif() 

我需要的NOT只对语句的第一次检查。

我得到以下错误:

CMake Error: Error in cmake code at 
/.../XXX.cmake:123: 
Parse error. Function missing ending ")". Instead found left paren with text "(". 

欣赏你的帮助。

+1

我不能在本地重现此。哪个CMake版本?你能提供一个独立的[mcve]吗? – Angew

+0

[CMake error near near if:“if given arguments”后跟parantheses,“NOT”,“EUQALS”和类似的]可能重复(http://stackoverflow.com/questions/39707772/cmake-error-near-if-如果赋予的论点,接着按括号 - 不euqal) – usr1234567

回答