[Insight-developers] RE: [Cmake] Generating code during the build: Fluid FLTK
Miller, James V (CRD)
millerjv@crd.ge.com
Mon, 10 Dec 2001 10:26:04 -0500
Luis,
Did you resolve this problem? I am trying to get the Dashboard builds to run the fluid commands (I
updated them to fltk-1.0.11). But when I run cmake, I get this error:
C:\itkQuality\Insight-intel>c:\itkQuality\CMake\Source\cmake ../Insight
CMake Error: Bad target typeC:/itkQuality/Insight-intel/Examples/Curves2DExtract
or/ceExtractorConsoleGUI.cxx
CMake Error: Error Writing C:/itkQuality/Insight-intel/Examples/Curves2DExtracto
r/C:/itkQuality/Insight-intel/Examples/Curves2DExtractor/ceExtractorConsoleGUI.c
xx.dsp
CMake Error: Error Reading
CMake Error: Error Reading
This looks like the same problem you reported except that my cmake stops at this point and will not
proceed. Thus, I would say the wrap command is "not" working since I cannot build the rest of my
project.
Jim
-----Original Message-----
From: Luis Ibanez [mailto:ibanez@choroid.cs.unc.edu]
Sent: Monday, December 03, 2001 5:34 AM
To: Franck Bettinger
Cc: CMake developers (E-mail); insight-Developers
Subject: Re: [Cmake] Generating code during the build: Fluid FLTK
Hi Franck
Thanks a lot for your indications. They were very useful
for tracking down the problem. As you said, the problem was that
cmake couldn't find the .h as the time of defining dependencies.
I followed your indications about adding the Fluid output
directory to the list of INCLUDE directories and also
created a subdirectory named "GUI" at this output position.
All this is done by FLTKWrapUI command so that users don't
need to write it in their CMakeLists.txt files.
In addition to that, it turned out that our package (Insight)
defined at the top level CMakeList.txt a regular expression
to select the #include files that are considered to be added
in the cmake.depends file. In our case it is:
INCLUDE_REGULAR_EXPRESSION("^(itk|vtk|vnl|vcl|f2c).*$")
So only files starting with : itk, vtk, vnl ...etc
were being included in the dependencies. The file generated
by FLTK had an arbitrary name that didn't match this
regular expression. So I had to extend the expression
in order to accept also this file.
------
I have a remanent question about the code in cmMakeDepend.cxx,
Around lines 188 - 191, when the include file has not been
found directly, cmMakeDepend tries combinations with the
directories in the INCLUDE_DIRECTORY list to see if any of them
match the file that is going to be generated. However, when
building these paths, the include directories are concatenated
with "path" which in line 124 has been assigned to a full
expanded path, that results (at least for my case) in a lot
of paths of the form:
"/home/ibanez/include/home/ibanez/include/Insight/...."
^^^ ^^^
Where the root directory was included twice.
Is that due to an error in the way I'm generating the names
for the generated code ?
----
In any case, now the command is working Ok.
It was even possible to remove the "GUI" directory and
cmMakeDepend is still able to recognize that a .h file
will be generated in the output directory and it uses
the name for cmake.depends.
Thanks
Luis
===============================
---
On Thu, 29 Nov 2001, Franck Bettinger wrote:
> 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
>
>
--
Luis Ibanez CB#: 7060
Research Assistan Professor phone: (919) 843 5436
Division of Neurosurgery fax: (919) 966 6627
University of North Carolina at Chapel Hill email: ibanez@cs.unc.edu
Chapel Hill, NC 27599-7060 http://www.cs.unc.edu/~ibanez
_______________________________________________
Cmake mailing list
Cmake@public.kitware.com
http://public.kitware.com/mailman/listinfo/cmake