random
random

Reputation: 73

cmake parse error that repeats

I have the following line in a CMakeLists.txt file...

else
        message(FATAL_ERROR "Could not locate Lua 5.1.\n"
                "Please download from Lua website.")
endif

When I run cmake, I get the following error...

Parse error.  Expected "(", got newline with text "
".

Okay, I figure. That isn't valid syntax, so I'll just edit the cmake file to put it all on a line like so...

message(FATAL_ERROR "Could not locate Lua 5.1.\nPlease download from Lua website.")

Go to the directory where I ran cmake, delete all the cache stuff, re-run it, and I get the same error as before. I've even deleted that whole line and I keep getting the same error. I'm obviously missing something crucial that defines how cmake operates, but I'm not sure what.

Any help is appreciated.

Upvotes: 7

Views: 6858

Answers (1)

RobertJMaynard
RobertJMaynard

Reputation: 2257

The if, else, elseif, and endif all need () after them.

Upvotes: 23

Related Questions