2011/7/12 Jean-Christophe Fillion-Robin <jchris.filli...@kitware.com>
> Hi Daniel, > > This sounds like a great feature :), do you think you could also associate > a test with your changes ? > Done. I have updated the test and the documentation. Everything is in the 'genexp' branch of git://github.com/purpleKarrot/CMake.git > Out of curiosity, why "*the right set of include directories is unknown > until all components > have been processed*" ? > > If it resumes not to be the case, I believe using a CMakeCache variable > could do the job. > > For example: > > # Clear foo bar > set(FOOBAR_DIRS "" CACHE STRING "Foobar dirs" FORCE) > > ... > > add_subdirectory(C) > set(C_DIRS ..) # Collect C directories > set(FOOBAR_DIRS ${FOOBAR_DIRS} ${C_DIRS} CACHE STRING "Foobar dirs" FORCE) > include_directories(${FOOBAR_DIRS}) > add_libraries(C ...) > > > ... > > add_subdirectory(B) > set(B_DIRS ..) # Collect B directories > set(FOOBAR_DIRS ${FOOBAR_DIRS} ${B_DIRS} CACHE STRING "Foobar dirs" FORCE) > include_directories(${FOOBAR_DIRS}) > add_libraries(B ...) > > ... > > add_subdirectory(A) > set(A_DIRS ..) # Collect A directories > set(FOOBAR_DIRS ${FOOBAR_DIRS} ${A_DIRS} CACHE STRING "Foobar dirs" FORCE) > include_directories(${FOOBAR_DIRS}) > add_libraries(A ...) > This works for the simple A->B->C dag from my example, but only because you already knew the dependencies. Otherwise you would not have reordered them. What if additionally C depends on A? cheers, Daniel
_______________________________________________ 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