<div class="gmail_quote">On Thu, Sep 17, 2009 at 12:51 PM, Eric Noulard <span dir="ltr"><<a href="mailto:eric.noulard@gmail.com" target="_blank">eric.noulard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
2009/9/17 <<a href="mailto:th.tom@gmx.de" target="_blank">th.tom@gmx.de</a>>:<br>
<div>> Hi,<br>
><br>
> I may haven't used the right keywords on google, as I believe this is asked many times befor:<br>
><br>
> I have a multiplatform project that uses external tools (yacc/bison/lex/flex).<br>
><br>
> 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.<br>
><br>
> 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):<br>
><br>
> YACC started with command C:/Programme/GnuWin32/bin/bison.exe<br>
> C:\Programme\GnuWin32\bin\bison.exe: m4: No such file or directory<br>
><br>
> m4 is installed in the same directory (C:/Programme/GnuWin32/bin) as bison and flex.<br>
<br>
</div>We use CMake + Flex/Bison for our project<br>
<a href="https://savannah.nongnu.org/projects/certi" target="_blank">https://savannah.nongnu.org/projects/certi</a><br>
(install doc is here: <a href="http://www.nongnu.org/certi/certi_doc/index.html" target="_blank">http://www.nongnu.org/certi/certi_doc/index.html</a><br>
but there is not much to discover)<br>
<br>
We did face the same "m4 not found" trouble and it has<br>
been "fixed" by putting<br>
C:/Programme/GnuWin32/bin<br>
in the system PATH and restart (at least) Visual Studio.<br>
<div><br>
> Setting the environment path does not help<br>
> (as visual studio does not care for these settings).<br>
<br>
</div>That's true the culprit here is bison.exe which assume m4.exe is in the path.<br>
<br>
our (primitive) FindLexYacc.cmake is here:<br>
<a href="http://cvs.savannah.gnu.org/viewvc/certi/scripts/FindLexYacc.cmake?root=certi&view=markup" target="_blank">http://cvs.savannah.gnu.org/viewvc/certi/scripts/FindLexYacc.cmake?root=certi&view=markup</a><br>
<br>
the CUSTOM command and others concerning Lex/Yacc handling may<br>
be found in the following CMakeLists.txt<br>
<a href="http://cvs.savannah.gnu.org/viewvc/certi/libCERTI/CMakeLists.txt?root=certi&view=markup" target="_blank">http://cvs.savannah.gnu.org/viewvc/certi/libCERTI/CMakeLists.txt?root=certi&view=markup</a><br>
<br>
those 2 are not what I would call "pure academic" examples but they do work<br>
for us on several Windows box (200x, XP, Vista, ...) with different IDEs<br>
(Visual, Code::Blocks, ...)<br></blockquote><div><br>FWIW, FindFLEX.cmake and FindBISON.cmake were both recently checked into CMake CVS and might be worth a look.<br><br><a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindFLEX.cmake?root=CMake&view=log">http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindFLEX.cmake?root=CMake&view=log</a><br>
<a href="http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindBISON.cmake?root=CMake&view=log">http://public.kitware.com/cgi-bin/viewcvs.cgi/Modules/FindBISON.cmake?root=CMake&view=log</a><br><br>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?<br>
<br></div></div>-- <br>Philip Lowman<br>