Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cmake parse error that repeats

Tags:

cmake

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.

like image 775
random Avatar asked Apr 11 '11 04:04

random


People also ask

What is cmakeparsearguments in C++?

Previously, it has been defined in the module CMakeParseArguments. This command is for use in macros or functions. It processes the arguments given to that macro or function, and defines a set of variables which hold the values of the respective options.

What happens if uniqueness is violated in CMake?

A warning will be emitted if uniqueness is violated. When done, cmake_parse_arguments will consider for each of the keywords listed in <options>, <one_value_keywords> and <multi_value_keywords> a variable composed of the given <prefix> followed by "_" and the name of the respective keyword.

What is parse error in command line argument-D?

Parse error in command line argument: -D Should be: VAR:type=value CMake Error: No cmake script provided. CMake Error: Problem processing arguments. Aborting.


1 Answers

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

like image 183
RobertJMaynard Avatar answered Sep 27 '22 22:09

RobertJMaynard