On Saturday 16 January 2010, Christoph Cullmann wrote:
> Hi,
>
> I try to install a flex generated file: (lex.loopmap_.cpp)
>
> CMakeLists.txt excerpt:
>
> set (cfg_cfiles_install
>         files
>         conmap.cpp
>         loopmap.cpp
>         regmap.cpp
>         mapping.cpp
>         lex.loopmap_.cpp
>         paggdl.cpp
>         scc.cpp
>         sort.cpp
>         sort_exp.cpp
> )
>
> # install some source files
> install(FILES ${cfg_cfiles_install} DESTINATION ${CFGDIR_C})
>
> # targets to refresh the scanner
> ADD_CUSTOM_COMMAND(
>     OUTPUT "lex.loopmap_.cpp"
>     COMMAND flex ARGS -8 -Ploopmap_ -olex.loopmap_.cpp map.lex
>     DEPENDS "map.lex"
>     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
>
>
> But CMake doesn't call flex and fails at install.

Because there is no target which needs the generated files.
You could use add_custom_target(... ALL ...) instead of add_custom_command(), 
then it will always be built.

Alex


> How do I tell it the dependency to generate the file on demand if not there
> or the .lex was changed?

_______________________________________________
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