I have a fundamental decision to take on how to structure the CMake project layout of our (existing) project (1000+ source files). While there are some libraries, which I will include via add_subdirectory
and add_library
the majority of our components are organized in many subdirectories and included as source files.
Reading through @craig.scott’s very helpful Professional CMake, I tend to use add_subdirectory
and target_sources
. But there is also the option of object libraries: add_library(targetName OBJECT ...
When would that be more appropriate?