Hi Glenn,
On Wed, Sep 7, 2011 at 20:36, Glenn Coombs <glenn.coo...@gmail.com> wrote: > Could you not create a file in each subdirectory called something like > header-deps.cmake ? This file would contain the include_directory() > commands necessary for using this module, plus include() commands of other > modules that it depends on. So for your example: > > # utils/b/header-deps.cmake > include_directories(...) > include(${CMAKE_SOURCE_DIR)/utils/a/header-deps.cmake) > > # utils/a/header-deps.cmake > include_directories(${CMAKE_SOURCE_DIR}/common/foo) > > Then you can just do include(${CMAKE_SOURCE_DIR}/utils/b/header-deps.cmake) > and it will add everything that B needs including all its dependencies. My understanding of Victor's question is that he would like (and I agree, it would be nice) for these dependencies to be determined by CMake auto-magically. So, whether we add include_directories () to the CMake file or have a header-deps.cmake file is perhaps not as important (though, your suggestion would reduce the amount of clutter in the CMakeLists.txt file). Perhaps a script is more suitable for this task? That is, it would walk through the directories and update each directories' header-deps.cmake. Surely, if a script is used, it would be less error-prone to have the script update an external file than the CMakeLists.txt file itself. Fortunately for me, the depth of my directories is not as deep as Victor's, so I'm not quite there yet. But perhaps later... 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