[CMake] Re: Out of source build and KDevelop

Andy Cedilnik andy.cedilnik at kitware.com
Wed Oct 20 17:23:11 EDT 2004


Hi Alex,

On Wed, 2004-10-20 at 15:46, Alexander Neundorf wrote:
> In order to show up in the file tree, yes. In order to show up in the  
> file groups, no.  

I think the File-Groups display is where you are interested. When things
are outside the source tree (such as in some different directory in the
global project), they should not appear file-tree. 

I would say your code organization may be wrong too, if you are having
the following scenario:

  /p1/PROJECT(p1)
  /p2/PROJECT(p2)
  /src

and now you use the code from src in p1 and p2. You should really build
a library from the common things and then link it in p1 and p2.

VTK is typical example of that. There are several projects (zlib, jpeg,
tiff, freetype), that are build independently. Then there are the kits
(Common, IO, Rendering ...) and each one is self-contained, which means
it does not include source code from some other directory. It does
include header files, but that is different, since these header files
could in theory be installed on the system. Now, in practice you would
never build Common and install it on the system, but then build your own
Rendering and use installed header files from the installed Common, but
in other large projects you may. 

So, what I am getting to is that PROJECT() command should be in the top
of your source code cluster that is "self-contained".

				Andy
  
> Ok, and here comes my daily cmake patch.  
> I think it does now everything we talked about except the global  
> generator switch.  
> Now it generates a kdevelop project for every CMakeLists.txt which  
> contains a PROJECT() calland the kdevelop project directory is always  
> GetHomeDirectory().  

p.s. Thanks for the great work.



More information about the CMake mailing list