[CMake] external tools in visual studio

Philip Lowman philip at yhbt.com
Tue Sep 22 22:13:52 EDT 2009


On Thu, Sep 17, 2009 at 12:51 PM, Eric Noulard <eric.noulard at gmail.com>wrote:

> 2009/9/17  <th.tom at gmx.de>:
> > Hi,
> >
> > I may haven't used the right keywords on google, as I believe this is
> asked many times befor:
> >
> > I have a multiplatform project that uses external tools
> (yacc/bison/lex/flex).
> >
> > I don`t have any problems under linux/solaris etc. but I really had a bad
> time trying to make this work under windows visual studio 2003.
> >
> > I am searching for bison and flex and these tools are found and are used.
> However, bison uses an additional tool "m4" this one is not found (as it is
> internally called, and there is no path set to this):
> >
> > YACC started with command  C:/Programme/GnuWin32/bin/bison.exe
> > C:\Programme\GnuWin32\bin\bison.exe: m4: No such file or directory
> >
> > m4 is installed in the same directory (C:/Programme/GnuWin32/bin) as
> bison and flex.
>
> We use CMake + Flex/Bison for our project
> https://savannah.nongnu.org/projects/certi
> (install doc is here: http://www.nongnu.org/certi/certi_doc/index.html
>  but there is not much to discover)
>
> We  did face the same "m4 not found" trouble and it has
> been "fixed" by putting
> C:/Programme/GnuWin32/bin
> in the system PATH and restart (at least) Visual Studio.
>
> > Setting the environment path does not help
> > (as visual studio does not care for these settings).
>
> That's true the culprit here is bison.exe which assume m4.exe is in the
> path.
>
> our (primitive) FindLexYacc.cmake is here:
>
> http://cvs.savannah.gnu.org/viewvc/certi/scripts/FindLexYacc.cmake?root=certi&view=markup
>
> the CUSTOM command and others concerning Lex/Yacc handling may
> be found in the following CMakeLists.txt
>
> http://cvs.savannah.gnu.org/viewvc/certi/libCERTI/CMakeLists.txt?root=certi&view=markup
>
> those 2 are not what I would call "pure academic" examples but they do work
> for us on several Windows box (200x, XP, Vista, ...) with different IDEs
> (Visual, Code::Blocks, ...)
>

FWIW, FindFLEX.cmake and FindBISON.cmake were both recently checked into
CMake CVS and might be worth a look.

http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindFLEX.cmake?root=CMake&view=log
http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindBISON.cmake?root=CMake&view=log

The FindBISON module will suffer the same problem as posted above.  Someone
could a patch into the bison people to allow the full path to m4 to be
specified as a command line option?

-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090922/d7410f48/attachment.htm>


More information about the CMake mailing list