Hi Olaf,

Le 3 févr. 2013 14:03, "Olaf Peter" <[email protected]> a écrit :
> ---8<---
> project(coolcoding)
>
> # generate coolcoding's static lexer
> set(COOLCODING_BAR_HPP
${PROJECT_BINARY_DIR}/include/foo/io/coolcoding/coolcoding_bar.hpp)
>
> add_executable(generate_coolcoding_bar generate_coolcoding_bar.cpp)
>
> add_custom_command(
>    OUTPUT  ${COOLCODING_BAR_HPP}
>    COMMAND generate_coolcoding_bar ${COOLCODING_BAR_HPP}
>    )

You might want to add

DEPENDS generate_coolcoding_bar

to this command.

> add_custom_target(coolcoding_dfa DEPENDS ${COOLCODING_BAR_HPP})

I'm not sure why you need this.

> What is the recommended way the generate header not in the source-build
dir self (means where the generate_coolcoding_bar.cpp is placed)?

I do not know if it is the recommended way or not, but usually, my
generators take an input argument with the desired outup file path. You can
then easily pass that full path from cmake (in the add_custom_command).

Hope it helps
--

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

Reply via email to