[CMake] Bison extra headers

Philip Lowman philip at yhbt.com
Fri Feb 12 21:27:09 EST 2010


They could be if you want.  Just open up a bug ticket with some info
on how to reproduce and your bison command line and I'll see what I
can do.  I'm pretty sure all we would have to do is add position.hh,
location.hh and stack.hh as OUTPUTs for the custom command for them to
be automatically cleaned.  All that would need to be known is how they
get generated (special flag to parse?).

On Thu, Feb 11, 2010 at 1:01 PM, Hilton Medeiros
<medeiros.hilton at gmail.com> wrote:
> FYI, I won't put these in the issues tracker because I really don't
> think these should be solved by the FindBISON module.
>
> On Thu, 11 Feb 2010 10:57:44 -0200
> Hilton Medeiros <medeiros.hilton at gmail.com> wrote:
>
>> Hello,
>>
>> I'm using bison_target() from FindBISON with the C++ bison interface,
>> on CMake 2.8.0. When using this interface the following extra files
>> are generated by bison:
>>
>> location.hh
>> position.hh
>> stack.hh
>>
>> They do not get listed in BISON_target_OUTPUTS and do not get erased
>> in 'make clean'.
>>
>> See here:
>> http://www.gnu.org/software/bison/manual/html_node/C_002b_002b-Bison-Interface.html
>>
>> Note that this manual seems outdated, there is no 'lalr1.c' for me,
>> only 'lalr1.cc' on bison 2.4.1. Anyway, this is a very small issue,
>> this is the workaround I'm using:
>>
>> set (BISON_EXTRA_HEADERS
>>     ${PROJECT_BINARY_DIR}/position.hh
>>     ${PROJECT_BINARY_DIR}/location.hh
>>     ${PROJECT_BINARY_DIR}/stack.hh
>> )
>>
>> set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
>> "${BISON_EXTRA_HEADERS}")
>>
>> By the way, I saw that the main header file generated on
>> bison_target() is always terminated by '.hpp'. I tried to bypass this
>> with:
>>
>> bison_target (PARSER ${PARSER_FILE} ${PROJECT_BINARY_DIR}/Parser.cpp
>>               COMPILE_FLAGS
>> --defines="${PROJECT_BINARY_DIR}/Parser.h")
>>
>> But then both Parser.hpp and Parser.h are generated. But this is also
>> a very small issue.
>>
>> Finally, thanks a lot for supporting bison and flex in CMake.
>>
>> Kind regards,
>> visibility guy
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Philip Lowman


More information about the CMake mailing list