Issue resolved: CMake does have a lot of catches, but finally with the Cache I managed to meet my wishes.
Consider you want to include files according to the following structure:
orxonox
objects
worldentities
Your CMLs in orxonox folder folder should look like this:
Code: Select all
SET( SRC_FILES FooBar.cc FooBar2.cc )
ADD_SOURCE_DIRECTORY(SRC_FILES objects)
In orxonox/objects, the CMLs looks a little bit different:
Code: Select all
SET( SRC_FILES BarFoo.cc BarFoo2.cc )
ADD_SOURCE_DIRECTORY(SRC_FILES worldentities)
# Do this after ADD_SOURCE_DIRECTORY !
ADD_SOURCE_FILES(SRC_FILES)
And for the third CMLs in orxonox/object/worldentities:
Code: Select all
SET( SRC_FILES AsdfBlah.cc AsdfBlah2.cc )
ADD_SOURCE_FILES(SRC_FILES)
Note that variables in subdirectories are in a completely separate set. You cannot override any variable in the parent directory and vice versa.
I have applied that concept to all our own folders in the trunk.