[CMake] Using gnu flex with cmake

Derek Cole derek.cole at gmail.com
Mon Dec 17 14:23:44 EST 2012


Thanks - that seemed to work. I was under the impression I could specify
where I wanted the .c file to go with the 2nd argument. I had tried this
way before, but i didnt notice I think I had a syntax error in my .l file
causing the compile to not complete.

Thanks

-Derek

On Mon, Dec 17, 2012 at 2:09 PM, Eric Noulard <eric.noulard at gmail.com>wrote:

>
>
> 2012/12/17 Derek Cole <derek.cole at gmail.com>
>
>> Replying to fix the subject
>>
>> On Mon, Dec 17, 2012 at 1:45 PM, Derek Cole <derek.cole at gmail.com> wrote:
>>
>>>
>>>    I am trying to figure out what I am doing wrong when trying to use
>>> just flex in a Cmake file to build a shared lib.
>>>
>>> i basically have the following
>>>
>>> find_package(FLEX)
>>> FLEX_TARGET(Test ../src/test.l ../src/test.c)set(SRC_FILES mysource.c ${FLEX_Test_OUTPUTS})
>>> add_libary(testlib ${SRC_FILES})
>>> target_link_libraries(testlib crypto c ${FLEX_LIBRARIES})
>>>
>>> this is giving me a problem saying it cant find ../src/test.c
>>>
>>
> Could you try using absolute path for FLEX output:
>
> FLEX_TARGET(Test ../src/test.l ${CMAKE_CURRENT_BINARY_DIR}/test.c)
>
>
>  any ideas how I can make sure Lex ran first? secondly,how can i pass my
>>> -L and -d options to lex (like I am doing in my normal, pre-cmake version
>>> of this makefile)
>>>
>>
> the FLEX_TARGET macro should be printing something out when running.
>
>
> --
> Erk
> Le gouvernement représentatif n'est pas la démocratie --
> http://www.le-message.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20121217/51a05d89/attachment.htm>


More information about the CMake mailing list