Hi Rolf,
On Thu, Dec 2, 2010 at 23:36, Rolf Eike Beer <e...@sf-mail.de> wrote: > Let's say you have > > dirA, dirB, dirC > > dirA builds a lib > dirB builds a lib that needs libA > dirC builds a target that needs libA and libB > > Then you can't do > > > libB/CMakeLists.txt > ADD_SUBDIRECTORY(../dirA dira) > > libB/CMakeLists.txt > ADD_SUBDIRECTORY(../dirA dira) > ADD_SUBDIRECTORY(../dirB dirb) > > > CMakeLists.txt > > ADD_SUBDIRECTORY(dirA) > ADD_SUBDIRECTORY(dirB) > ADD_SUBDIRECTORY(dirC) Yes -- that's exactly what I was trying to say. Thank you for the example! I suppose the default behavior of ADD_SUBDIRECTORY is understandable since it is meant to catch duplicate names. By this I mean that maybe its aim was to catch these problems when they are caused by human error. > since dirA is included twice. We have a module for that: > > function (Add_Subdirectory_Once SUBDIRECTORY) ... Thank you for this! I presume by "We" you mean you and your organization? That is, this function isn't in CMake. I'll give it a try and see if it solves my problems. Thank you all for your explanations! Ray _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake