Re: [CMake] Project Structure and add_subdirectory()

2019-09-30 Thread Marek Vojtko
> Why would you build targets you don't depend upon in my original proposal? > you certainly include them all in your project, but as long as you build your > application target, only it's actual dependencies will be built. Of course, > if you build the "all" target, everything will be built,

Re: [CMake] Project Structure and add_subdirectory()

2019-09-28 Thread Avraham Shukron
dependencies will be built. Of course, if you build the "all" target, everything will be built, but that could easily be avoided with EXCLUDE_FROM_ALL when adding the `components` subdirectory. > > *From:* Avraham Shukron > *Sent:* Friday, September 27, 2019 5:23 PM > *To

Re: [CMake] Project Structure and add_subdirectory()

2019-09-27 Thread Marek Vojtko
Sent: Friday, September 27, 2019 5:23 PM To: Marek Vojtko Cc: cmake@cmake.org Subject: Re: [CMake] Project Structure and add_subdirectory() I think option 2 (keeping track on transitive dependencies) should be out of the question. It is bound to fail. Superbuild setup makes sense where all

Re: [CMake] Project Structure and add_subdirectory()

2019-09-27 Thread Avraham Shukron
I think option 2 (keeping track on transitive dependencies) should be out of the question. It is bound to fail. Superbuild setup makes sense where all the components are part of a bigger whole. But if each application may depend on a different "flavor" of a dependency library, I think it should

[CMake] Project Structure and add_subdirectory()

2019-09-27 Thread Marek Vojtko
Using add_subdirectory() in a "superbuild" setup is straightforward: Create a root CMakeLists.txt which calls add_subdirectory() on all directories of your project and each target can then use target_link_libraries() without worrying where the target came from. Unfortunately the "superbuild"