Hi Julien,

CMake correctly identifies that gen.90f depends on gen.f90.sh, but you
have no code to tell CMake that usegen.f90 depends on gen.f90. The
following should do the trick:

set_property(SOURCE usegen.f90 PROPERTY OBJECT_DEPENDS
"${CMAKE_BINARY_DIR}/gen.f90")

Petr

On Mon, Mar 11, 2013 at 11:41 AM, Julien Bigot <jul...@julien-bigot.fr> wrote:
> Hi,
>
> I'm using cmake with something like that
>
> add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/gen.f90"
>         COMMAND bash ARGS "${CMAKE_SOURCE_DIR}/gen.f90.sh" ">"
> "${CMAKE_BINARY_DIR}/gen.f90"
>         MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/gen.f90.sh"
>         VERBATIM
> )
>
> add_library(mylib STATIC usegen.f90 "${CMAKE_BINARY_DIR}/gen.f90")
>
> gen.f90 defines a module gen_module and usegen uses this module
>
> unfortunately cmake doesn't seem to catch the dependency and tries to compile
> usegen.f90 before gen.f90 resulting in an error of missing gen_module.mod
>
> I've tried to set the gen.f90 property GENERATED to TRUE but this does not
> seem to have any effect ...
>
> Could someone give me some hint to understand what I'm doing wrong ?
>
> Regards,
> --
> Julien Bigot, Ph.D.  --  http://work.julien-bigot.fr
> Maison de la Simulation USR 3441 - bât. 565 - CEA Saclay
> 91191 Gif-sur-Yvette CEDEX - FRANCE
> phone: (+33) 1 69 08 01 75  --  xmpp: jbi...@jabber.org
> --
>
> 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
--

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