Fix cmake bugs#25
Conversation
rayandrew
left a comment
There was a problem hiding this comment.
looks good to me, thank you @JaeseungYeom !
|
@JaeseungYeom that is by design to point to parent. The reason it when I have nested project more than two and added a submodules it will mess up build paths. What is the issue this creates can you elaborate? |
|
I assume the reason you chose that is to make sure subprojects are found regardless of hierarchy of projects. That was necessary with ExternalProject_Add() which runs at build time. With ExternalProject_Add, since targets are not available at configure time, the only way to find built artifacts was to use well-known paths. external projects also had to be built in separate build steps. It is no longer necessary with FetchContent that runs at configure time. cmake processes all subprojects during configuration and their targets are immediately available. No need for a shared install location. The entire project hierarchy is built in one step with proper dependency ordering automatically handled by cmake. The benefit is that now each subproject is isolated in its own binary directory and does not pollute the parent's build directory. The updated cpp-logger builds no problem under brahma with or without dftracer and with or without dyad. |
|
@rayandrew can u test it a bit. The goal is all projects like DFTracer, Brahma DFTracer-utils build nicely with this change. |
|
@JaeseungYeom @hariharan-devarajan I tested locally and it works fine. |
|
hi @JaeseungYeom can you remove the version bumping in this PR since this is build-related issues? Thank you! |
Addressing issue #24
When FetchContent builds a dependency package, the variable needed in this CMakeLists.txt is CMAKE_CURRENT_BINARY_DIR because CMAKE_BINARY_DIR points to that of the upper project.