Hi, On Thu, May 17, 2012 at 11:36 PM, David Doria <[email protected]> wrote:
> Why are you doing that? If TestB is always available as sub-dir under >> TestA it doesn't make much sense to also add it as a subdirectory of the >> parent of TestA - IMHO. Test/CMakeLists.txt can still use all targets from >> TestB, since target names are always valid across the complete project. >> >> Since TestA is a submodule, it should always be present in the sources >> anyway. >> >> Andreas >> > > I use functionality of TestB in Test. If TestA decides to remove TestB, > then Test will break. I was trying to "hide" the implementation of TestA > by requiring both TestA and TestB to be submodules of Test, regardless of > whether or not TestA has TestB as a submodule of its own. > > See what I mean? > Yeah. Well, in that case I'd simply check for the TestB target thats defined in TestB/CMakeLists.txt as condition for the top-levels add_subdirectory: if(NOT TARGET TestB) add_subdirectory(TestB) endif() That should work. Andreas
-- 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
