[CMake] Problem with generated source files and Fortran90 modules

2013-03-11 Thread Julien Bigot
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 u

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-11 Thread Petr Kmoch
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

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-13 Thread Julien Bigot
Hi, On Tuesday 12 March 2013 7:37 AM Petr Kmoch wrote: > 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_DE

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-13 Thread Brad King
On 03/11/2013 06:41 AM, Julien Bigot wrote: > 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 STA

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-13 Thread Julien Bigot
On Wednesday 13 March 2013 8:27 AM Brad King wrote: > On 03/11/2013 06:41 AM, Julien Bigot wrote: > > 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

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-13 Thread Julien Bigot
On Wednesday 13 March 2013 2:11 PM Julien Bigot wrote: > On Wednesday 13 March 2013 8:27 AM Brad King wrote: > > On 03/11/2013 06:41 AM, Julien Bigot wrote: > > > add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/gen.f90" > > > > > > COMMAND bash ARGS "${CMAKE_SOURCE_DIR}/gen.f90.sh" ">" > > > > > >

Re: [CMake] Problem with generated source files and Fortran90 modules

2013-03-13 Thread Brad King
On 03/13/2013 09:33 AM, Julien Bigot wrote: > This might also be related to the fact that all uses of the module are > included inside #ifdef MYMACRO ... #endif where MYMACRO is defined with > set_property(SOURCE usegen.f90 APPEND PROPERTY > COMPILE_DEFINITIONS_DEBUG MYMACRO) Yes, I think that i