[Cmake] cmSourceFilesCommand : SOURCE_FILES NAME file AS target

sebastien at barre.nom.fr sebastien at barre.nom.fr
Mon May 14 10:29:23 EDT 2001


Ken Martin écrit:

> Bill and I discussed this and we think the specific problem can be
> solved by creating a new file in VTK
> 
> vtkTkRenderWidgetPython.cxx
> 
> that conatins the code
> 
> #define VTK_PYTHON_BUILD  (or whatever it is)
> #include "vtkTkRenderWidget.cxx"
> 
> Because it has a different name it will get compiled into a different
> object file avoiding the file overwrite issue.

Correct me if I'm wrong, but will the dependency be generated correctly ?
I.e, if I modify vtkRenderWidget.cxx, will vtkTkRenderWidgetPyhton.cxx be
recompiled automatically ? I do not know how the dependency are computed by
CMake, and I'm not on my computer right now. I think the #include
"whatever.cxx" inside a .cxx is a bit dangerous for that reason. And we all
know how some dependency problems in the old tree have lead many of us to
several hours spent trying to locate simple problems :) 

If you think it's OK, than it's fine to me, I'll "cvs add" the files in the
new tree, and add them to CMakeLists.txt. 

Although I'm fairly sure this extension to SOURCE_FILES would be useful,
I'd like to say that I sincerely think that the cmSourceFile class need at
least a GetTargetName() member, even if it returns the source name for the
moment. It seems logical in an API point of view that when someone wants
the target name of the source file it should calls such GetTargetName, and
not necesseraly GetSourceName. If we want to make this change, we probably
have to make it quickly, before there are hundreds of calls to
GetSourceName :) Just my opinion anyway.

Thanks








More information about the CMake mailing list