[CMake] No support for lex/flex and yacc/bison?

Mielcarek, Donn Donn.Mielcarek at wylelabs.com
Wed May 16 12:16:42 EDT 2007


Thanks for posting the flex/bison code.

Two things:

I had to change:
 SET(BISON_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/${parser_base}.tab.cc")
to
 SET(BISON_TAB_C "${CMAKE_CURRENT_BINARY_DIR}/${parser_base}.tab.bison_cc")

(and likewise for the other constructs)

Otherwise I would get the message:
CMake Error: Attempt to add a custom rule to output "[...]/parser.cc.rule"
 which already has a custom rule.


The other issue is the creation of the library, which is
a problem I've been struggling with.

ADD_LIBRARY(mylib ${BF_SOURCES})
causes the error message:

You have called ADD_LIBRARY for library mylib without any source files. This
typically indicates a problem with your CMakeLists.txt file

I added:
SET_SOURCE_FILES_PROPERTIES(${BF_SOURCES} GENERATED)

but it doesn't help.






Date: Wed, 16 May 2007 00:24:15 -0600
From: James Bigler <bigler at cs.utah.edu>
Subject: Re: [CMake] No support for lex/flex and yacc/bison?
To: "Clark J. Wang" <dearvoid at gmail.com>
Cc: CMake Mailing List <cmake at cmake.org>
Message-ID: <464AA38F.7000508 at cs.utah.edu>
Content-Type: text/plain; charset="utf-8"

Clark J. Wang wrote:
> I read through the CMake's man page and found no support for lex/flex and
> yacc/bison. Need I define my own rules to handle with lex/yacc source 
> files?

Yup, I haven't seen one either.  I've attached the one that I've wrote and have 
been using.  It does some fiddling with the output file names, but you can see 
that in the code.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/ms-tnef
Size: 3592 bytes
Desc: not available
Url : http://public.kitware.com/pipermail/cmake/attachments/20070516/4c88ef26/attachment.bin


More information about the CMake mailing list