Include directories idea

Andras Mantia amantia at kde.org
Tue Apr 25 19:12:52 CEST 2006


Hi,

 (I admit I still use the old cmake snapshot release, not 2.4.0, so 
correct me if this was changed/fixed/implemented).
 If you have a builddir != srcdir setup and use ui or kcfg files, they 
are generated in the builddir. This means every CMakeList.txt file must 
have the ${CMAKE_BINARY_DIR}/path-to-the-directory added as an include 
source. Furthermore if the ui files are in a subdir, so you use 
something like

kde4_add_ui_files(yourtarget_PART_SRCS subdir/form.ui)   

and you subclass that form also in the subdir and you have

set(yourtarget_PART_SRCS formdialog.cpp )

you must add the following include as well:
${CMAKE_SOURCE_DIR}/path-to-the-directory/subdir

If you happen to use some header from the main dir in the implementation 
from the subdir, you must add
${CMAKE_SOURCE_DIR}/path-to-the-directory/

With automake, this was not so confusing as the subdirs were separate 
directories, so it made sense to have an include path added to the 
parent directory. With cmake, the files from the subdirs are listed in 
the parent's CMakeList.txt, which will look quite strange as you have 
to add the current directory as an include source. 
What I would like to see is that cmake automatically adds the following 
directories as an include source:
${CMAKE_BINARY_DIR}/path-to-the-directory
${CMAKE_SOURCE_DIR}/path-to-the-directory
${CMAKE_SOURCE_DIR}/path-to-the-directory/subdir

The last one might wait, but what would be nice is if cmake would look 
at all the subdirs listed in "set" or other rules where sources are 
added to the target and adds 
${CMAKE_SOURCE_DIR}/path-to-the-directory/subdir1 
${CMAKE_SOURCE_DIR}/path-to-the-directory/subdir2
etc.

It would make the CMakeList.txt files more clearer and for the developer 
it would be easier to use and create such files.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-buildsystem/attachments/20060425/185ade32/attachment.pgp 


More information about the Kde-buildsystem mailing list