[Cmake] Generating code during the build: Fluid FLTK

Franck Bettinger bettingf at cs.man.ac.uk
Thu Nov 29 03:06:43 EST 2001


Hi Luis,

It appears that the .h file can not be found. As this file does not exist at 
the time of the target creation, I've added a rule in cmMakeDepend.cxx that 
also look if the file will not be generated. Unfortunately there was a 
problem with the matching of the path (since we only know the name of the 
file itself and not its path). I had to guess the path by looking at the 
include directories.

So you have to add an INCLUDE_DIRECTORIES rule in your CMakeLists.txt that 
tells cmake where to look for.

For instance, with the Qt ui wrapper and vxl, I use a rule like this :

INCLUDE_DIRECTORIES( ${allvxl_BINARY_DIR} )
...
    QT_WRAP_UI(drawing
      drawing_ui_headers
      drawing_ui_sources
      drawing_interfaces
    )

and I include the .h file using :
#include <programs/drawing/drawing.h>

so that cmMakeDepend.cxx can find that the file 
${allvxl_BINARY_DIR}/programs/drawing/drawing.h
is in the target list.

Beware not to use a "/" at the end of your INCLUDE_DIRECTORIES path because 
the algorithm append it automatically and two "/" would cause the matching to 
fail.

I hope it helps.

Franck


On Thursday 29 November 2001 07:12, Luis Ibanez wrote:
> Hi,
>
> I'm adding a new command:   cmFLTKWrapUICommand
[...]
> There is however a problem with the creation of
> the customCommand in m_Makefile. The method
> verifies if the target in question already
> exists or not.  In this case the targets
> are the .cxx and .h generated files. A for that
> reason this new command is inserting directly
> the .cxx and .h as targets of the built.
>
>
> In order to support these files as a Type of
> targets was added to cmTarget: "GENERATED_CODE".
>
> A residual problem is appearing with the
> custom rule for the .h file, its rule
> is missing in the Makefile (under Linux).
> It seems that somewhere in the process
> the fils with .h extension are ignored as
> targets... The Custom rule for .cxx is working
> ok.
>
>
> Any suggestions ?
>
> Thanks,
>
> Luis

-- 
--
=========================================
Franck BETTINGER
PhD student 
Imaging Science and Biomedical Engineering
University of Manchester
bettingf at cs.man.ac.uk
==========================================



More information about the CMake mailing list